package com.hgkj.cloud.base.scheme;

import com.alibaba.fastjson.JSONObject;
import com.hgkj.cloud.base.common.AdminCommon;
import com.hgkj.cloud.base.scheme.table.*;
import com.hgkj.cloud.base.util.DateTimeUtil;

import java.math.BigDecimal;
import java.util.*;

/**
 * 量表计算过程
 */
public class ClsTest {

	public static List<ClsAnswerResult> g_Result = new ArrayList<ClsAnswerResult>();

	public static String g_sChar = "@@"; // 特殊答案@@
	public static String g_nChar = "\\|"; // 普通答案|

	// PPVT测试中间过程判断是否连续8题错6题
	// 4|3|1|1|4|2|2|1|4|2|3|4|4|2|2|1|4|1|1|1|3|3|1|3|4|1|4|2|4|2|1|3|2|3|1|1|4|4|4|4|1|1|2|1|3|3|3|2|1|4|4|2|2|4|3|3|3|2|1|2|1|3|1|1|1|2|4|2|3|4|4|2|3|2|4|4|2|3|2|1|1|1|1|1|1|1|1|4|1|1|3|3|4|1|1|1|2|3|3|1|3|3|1|2|3|1|3|2|1|3|2|1|4|4|3|3|3|2|2|2
	public static boolean getVerifyPPVT(String answer) {
		try {
			int intError = 0;
			int i;
			String[] strAnswer = answer.split("\\|");
			String[] strStandardAns = { "4", "3", "1", "1", "4", "2", "2", "1", "4", "2", "3", "4", "4", "2", "2", "1",
					"4", "1", "1", "1", "3", "3", "1", "3", "4", "1", "4", "2", "4", "2", "1", "3", "2", "3", "1", "1",
					"4", "4", "4", "4", "1", "1", "2", "1", "3", "3", "3", "2", "1", "4", "4", "2", "2", "4", "3", "3",
					"3", "2", "1", "2", "1", "3", "1", "1", "1", "2", "4", "2", "3", "4", "4", "2", "3", "2", "4", "4",
					"2", "3", "2", "1", "1", "1", "1", "1", "1", "1", "1", "4", "1", "1", "3", "3", "4", "1", "1", "1",
					"2", "3", "3", "1", "3", "3", "1", "2", "3", "1", "3", "2", "1", "3", "2", "1", "4", "4", "3", "3",
					"3", "2", "2", "2" };

			if (strAnswer.length < 8) {
				return true;
			} else {
				for (i = 1; i <= 8; i++) {
					if (!strAnswer[strAnswer.length - i].equals(strStandardAns[strAnswer.length - i])) {
						intError += 1;
					}
				}
				if (intError >= 6) {
					return false;
				} else {
					return true;
				}
			}
		} catch (ArithmeticException e) {
			return false;
		}
	}

	/**
	 * 心检项目测评计算
	 */
	public static String generateJsonData(String table_code, Integer user_gender, Long user_birth, String answer) {
		ClsAnswerRequest request = new ClsAnswerRequest();
		request.setType(table_code);
		request.setUuid("0");
		if (user_gender != null) {
			if (user_gender == 2) // 心检项目同步微信性别值，女性为2，转换为0
				user_gender = 0;
			request.setSex(user_gender);
		} else {
			request.setSex(AdminCommon.DEFAULT_MALE);
		}
		if (user_birth != null)
			request.setAge(DateTimeUtil.getFloatAgeByBirthday(user_birth));
		else {
			request.setAge(AdminCommon.DEFAULT_COLLEGE_AGE);
		}
		request.setAnswer(answer);
		ClsAnswerResult result = ClsTest.getAnswer(request);
		if (result != null)
			return JSONObject.toJSONString(result.getObject());
		else
			return "";
	}

	// 调用计算过程
	public static ClsAnswerResult getAnswer(ClsAnswerRequest answer) {
		TableCalculate bean = null;
		ClsAnswerResult result = null;
		switch (answer.getType()) {
		case "Rw":
			bean = new Table1();
			break;
		case "Rwgj":
			bean = new Table2();
			break;
		case "Group":
			bean = new Table3();
			break;
		case "Pf16":
			bean = new Table4();
			break;
		case "Mmpi399":
		case "Mmpi566":
			bean = new Table5();
			break;
		case "Epq":
			bean = new Table7();
			break;
		case "Xepq":
			bean = new Table8();
			break;
		case "Epps":
			bean = new Table9();
			break;
		case "Qizhi":
			bean = new Table10();
			break;
		case "Phi":
			bean = new Table11();
			break;
		case "Scl90":
			bean = new Table12();
			break;
		case "Upi":
			bean = new Table13();
			break;
		case "Ghq":
			bean = new Table14();
			break;
		case "Cmi":
			bean = new Table15(); //Table16和Table15一样
			break;
		case "Sds":
			bean = new Table17();
			break;
		case "Hamd":
			bean = new Table18();
			break;
		case "Bdi":
			bean = new Table19();
			break;
		case "Ces":
			bean = new Table20();
			break;

		case "Ndi":
			result = GetNdiFactorScore(answer);
			break;

		case "Sas":
			result = GetSasFactorScore(answer);
			break;

		case "Stai1":
			result = GetStai1FactorScore(answer);
			break;

		case "Stai2":
			result = GetStai2FactorScore(answer);
			break;

		case "Hama":
			result = GetHamaFactorScore(answer);
			break;

		case "Bai":
			result = GetBaiFactorScore(answer);
			break;

		case "Lsas":
			result = GetLsasFactorScore(answer);
			break;

		case "Fne":
			result = GetFneFactorScore(answer);
			break;

		case "Ask":
			result = GetAskFactorScore(answer);
			break;

		case "Sad":
			result = GetSadFactorScore(answer);
			break;

		case "Esli":
			result = GetEsliFactorScore(answer);
			break;

		case "Hads":
			result = GetHadsFactorScore(answer);
			break;

		case "Cprs":
			result = GetCprsFactorScore(answer);
			break;

		case "Bprs":
			result = GetBprsFactorScore(answer);
			break;

		case "Brms":
			result = GetBrmsFactorScore(answer);
			break;

		case "Sans":
			result = GetSansFactorScore(answer);
			break;

		case "Saps":
			result = GetSapsFactorScore(answer);
			break;

		case "Tess":
			result = GetTessFactorScore(answer);
			break;

		case "Sers":
			result = GetSersFactorScore(answer);
			break;

		case "Reses":
			result = GetResesFactorScore(answer);
			break;

		case "Adl":
			result = GetAdlFactorScore(answer);
			break;

		case "Sdss":
			result = GetSdssFactorScore(answer);
			break;

		case "YaleBrown":
			result = GetYaleBrownFactorScore(answer);
			break;

		case "Nosie":
			result = GetNosieFactorScore(answer);
			break;

		case "Mast":
			result = GetMastFactorScore(answer);
			break;

		case "Scap":
			result = GetScapFactorScore(answer);
			break;

		case "Gds":
			result = GetGdsFactorScore(answer);
			break;

		case "Bssd":
			result = GetBssdFactorScore(answer);
			break;

		case "His":
			result = GetHisFactorScore(answer);
			break;

		case "Hds":
			result = GetHdsFactorScore(answer);
			break;

		case "Mmse":
			result = GetMmseFactorScore(answer);
			break;

		case "Cbcl":
			result = GetCbclFactorScore(answer);
			break;

		case "Conn":
			result = GetConnFactorScore(answer);
			break;

		case "Pei":
			result = GetPeiFactorScore(answer);
			break;

		case "A":
			result = GetAFactorScore(answer);
			break;

		case "Fs14":
			result = GetFs14FactorScore(answer);
			break;

		case "Psqi":
			result = GetPsqiFactorScore(answer);
			break;

		case "Ucla":
			result = GetUclaFactorScore(answer);
			break;

		case "Asssm":
			result = GetAsssmFactorScore(answer);
			break;

		case "Dsq":
			result = GetDsqFactorScore(answer);
			break;

		case "Yffs":
			result = GetYffsFactorScore(answer);
			break;

		case "Les":
			result = GetLesFactorScore(answer);
			break;

		case "Issi":
			result = GetIssiFactorScore(answer);
			break;

		case "Jyyd":
			result = GetJyydFactorScore(answer);
			break;

		case "Fes":
			result = GetFesFactorScore(answer);
			break;

		case "Olson":
			result = GetOlsonFactorScore(answer);
			break;

		case "Lsr":
			result = GetLsrFactorScore(answer);
			break;

		case "Lsia":
			result = GetLsiaFactorScore(answer);
			break;

		case "Lsib":
			result = GetLsibFactorScore(answer);
			break;

		case "Motion":
			result = GetMotionFactorScore(answer);
			break;

		case "Gwb":
			result = GetGwbFactorScore(answer);
			break;

		case "Sf36":
			result = GetSf36FactorScore(answer);
			break;

		case "Ed":
			result = GetEdFactorScore(answer);
			break;

		case "Spdall":
			result = GetSpdallFactorScore(answer);
			break;

		case "Spdm":
			result = GetSpdmFactorScore(answer);
			break;

		case "Spdf":
			result = GetSpdfFactorScore(answer);
			break;

		case "Whoqol":
			result = GetWhoqolFactorScore(answer);
			break;

		case "Munsh":
			result = GetMunshFactorScore(answer);
			break;

		case "Connts":
			result = GetConntsFactorScore(answer);
			break;

		case "Connt":
			result = GetConntFactorScore(answer);
			break;

		case "Abc":
			result = GetAbcFactorScore(answer);
			break;

		case "Cars":
			result = GetCarsFactorScore(answer);
			break;

		case "Embu":
			result = GetEmbuFactorScore(answer);
			break;

		case "Aslec":
			result = GetAslecFactorScore(answer);
			break;

		case "Zyqx":
			result = GetZyqxFactorScore(answer);
			break;

		case "Hldzyqx":
			result = GetHldzyqxFactorScore(answer);
			break;

		case "Adhd":
			result = GetAdhdFactorScore(answer);
			break;

		case "Srss":
			result = GetSrssFactorScore(answer);
			break;

		case "Cgi":
			result = GetCgiFactorScore(answer);
			break;

		case "Nyls":
			result = GetNylsFactorScore(answer);
			break;

		case "Rutterp":
			result = GetRutterpFactorScore(answer);
			break;

		case "Ruttert":
			result = GetRuttertFactorScore(answer);
			break;

		case "Piersharris":
			result = GetPiersharrisFactorScore(answer);
			break;

		case "Etgj":
			result = GetEtgjFactorScore(answer);
			break;

		case "Csd":
			result = GetCsdFactorScore(answer);
			break;

		case "Sasc":
			result = GetSascFactorScore(answer);
			break;

		case "Dis":
			result = GetDisFactorScore(answer);
			break;

		case "Qsa":
			result = GetQsaFactorScore(answer);
			break;

		case "Psai":
			result = GetPsaiFactorScore(answer);
			break;

		case "Cts48m":
			result = GetCts48mFactorScore(answer);
			break;

		case "Cts13y":
			result = GetCts13yFactorScore(answer);
			break;

		case "Cbcl2to3":
			result = GetCbcl2to3FactorScore(answer);
			break;

		case "Sarasontas":
			result = GetSarasontasFactorScore(answer);
			break;

		case "Sm":
			result = GetSmFactorScore(answer);
			break;

		case "Xxza":
			result = GetXxzaFactorScore(answer);
			break;

		case "Xljk":
			result = GetXljkFactorScore(answer);
			break;

		case "Baby20":
			result = GetBaby20FactorScore(answer);
			break;

		case "Genius1":
			result = GetGenius1FactorScore(answer);
			break;

		case "Genius2":
			result = GetGenius2FactorScore(answer);
			break;

		case "Create":
			result = GetCreateFactorScore(answer);
			break;

		case "Xxff":
			result = GetXxffFactorScore(answer);
			break;

		case "Xxdj":
			result = GetXxdjFactorScore(answer);
			break;

		case "Yzldc":
			result = GetYzldcFactorScore(answer);
			break;

		case "Ksxwkl":
			result = GetKsxwklFactorScore(answer);
			break;
		case "Zbxl":
			result = GetZbxlFactorScore(answer);
			break;
		case "Zxsynl":
			result = GetZxsynlFactorScore(answer);
			break;
		case "Rjjwnl":
			result = GetRjjwnlFactorScore(answer);
			break;
		case "Txgxkr":
			result = GetTxgxkrFactorScore(answer);
			break;

		case "Ssgxkr":
			result = GetSsgxkrFactorScore(answer);
			break;

		case "Ybzwxng":
			result = GetYbzwxngFactorScore(answer);
			break;

		case "Gat":
			result = GetGatFactorScore(answer);
			break;

		case "Xxxljkzh":
			//result = GetXxxljkzhFactorScore(answer);
			bean = new Table126();
			break;
		case "Zxxljkzh":
			//result = GetZxxljkzhFactorScore(answer);
			bean = new Table127();
			break;
		case "Rc":
			//result = GetRcFactorScore(answer);
			bean = new Table128();
			break;
		case "Trauma":
			//result = GetTraumaFactorScore(answer);
			bean = new Table129();
			break;
		case "Shcrisis":
			//result = GetShcrisisFactorScore(answer);
			bean = new Table130();
			break;
		case "Shirritant":
			//result = GetShirritantFactorScore(answer);
			bean = new Table131();
			break;
		case "Ppvt":
			//result = GetPpvtFactorScore(answer);
			bean = new Table132();
			break;
		case "Cancer":
			//result = GetCancerFactorScore(answer);
			bean = new Table133();
			break;
		default:
			break;
		}
		if(bean!=null && result==null)
			result = bean.calc(answer);
		return result;
	}

	// 获取结果因子json字符串
	public static String getResultObjectString(ClsAnswerResult result) {
		String strResult = "";
		String mEducation = result.getEducation();
		strResult = JSONObject.toJSONString(result.getObject());
		return strResult;
	}








	// 二十一、纽卡斯尔抑郁诊断量表（Ndi）共10题 ****
	private static ClsAnswerResult GetNdiFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 10;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共三组，第一组-1,0，第二组1,0，第三组2,0
			String[] strNumberA = { "7,9", "1,3,5,10", "2,4,6,8" };
			String[] strSubA;
			int[][] intScoreA = { { -1, 0 }, { 1, 0 }, { 2, 0 } };

			int vFactor = 0; // 实际为1个因子

			// 总分
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactor += intScoreA[i][Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]) - 1];
				}
			}

			// 按“总分”得到“诊断结果”
			// 按“总分”得到“指导意见”
			int[] intValueA = { 6, 5 };
			// 标识应该是{2,1,3}
			String[] strValueA = { "内因性忧郁症", "为可疑内因性忧郁症", "可考虑为抑郁性神经症" };
			String vAppraise = strValueA[strValueA.length - 1];
			String vDoctorIdea = "Ndi.1.3";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactor >= intValueA[i]) {
					vAppraise = strValueA[i];
					vDoctorIdea = "Ndi.1." + String.valueOf(2 - i);
					break;
				}
			}

			ClsScore.Ndi ndi = new ClsScore.Ndi();

			ndi.setTotal_o(vFactor);
			ndi.setTotal_a(vAppraise);
			ndi.setTotal_d(vDoctorIdea);

			result.setObject(ndi);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 二十二、焦虑自评量表（Sas）共20题
	private static ClsAnswerResult GetSasFactorScore(ClsAnswerRequest answer) {
		// 总粗分，标准总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 20;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;
			// 共2组，第一组1,2,3,4，第二组4,3,2,1
			String[] strNumberA = { "1,2,3,4,6,7,8,10,11,12,14,15,16,18,20", "5,9,13,17,19" };
			String[] strSubA;
			int[][] intScoreA = { { 1, 2, 3, 4 }, { 4, 3, 2, 1 } };

			float[][] vFactorA = new float[1][2]; // 实际为1个因子
			for (i = 0; i < vFactorA.length; i++) {
				for (j = 0; j < vFactorA[0].length; j++) {
					vFactorA[i][j] = 0;
				}
			}

			// 原始分
			// 总粗分
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactorA[0][0] += intScoreA[i][Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]) - 1];
				}
			}
			// 标准总分
			BigDecimal bd = new BigDecimal(vFactorA[0][0] * 1.25);
			vFactorA[0][1] = bd.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();

			// 按原始分“诊断结果”
			// 按原始分“指导意见”
			int[] intValueA = { 39, 47, 55 };
			String[] strValueA = { "无", "有（轻度）", "有（中度）", "有（重度）" };
			String vAppraise = strValueA[strValueA.length - 1] + "焦虑症状";
			String vDoctorIdea = "Sas.1.4";

			for (i = 0; i < intValueA.length; i++) {
				if (vFactorA[0][0] <= intValueA[i]) {
					vAppraise = strValueA[i] + "焦虑症状";
					vDoctorIdea = "Sas.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Sas sas = new ClsScore.Sas();

			sas.setTotal_o(vFactorA[0][0]);
			sas.setTotal_s(vFactorA[0][1]);
			sas.setTotal_a(vAppraise);
			sas.setTotal_d(vDoctorIdea);

			result.setObject(sas);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 二十三、焦虑状态询问表（Stai1）共20题 ****
	private static ClsAnswerResult GetStai1FactorScore(ClsAnswerRequest answer) {
		// 状态焦虑
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 20;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共二组，第一组1,2,3,4，第二组4,3,2,1
			int[][] intNumberA = { { 3, 4, 6, 7, 9, 12, 13, 14, 17, 18 }, { 1, 2, 5, 8, 10, 11, 15, 16, 19, 20 } };
			int[][] intScoreA = { { 1, 2, 3, 4 }, { 4, 3, 2, 1 } };

			int vFactor = 0; // 实际为1个因子

			// 状态焦虑
			for (i = 0; i < intNumberA.length; i++) {
				for (j = 0; j < intNumberA[0].length; j++) {
					vFactor += intScoreA[i][Integer.valueOf(sAnswer[intNumberA[i][j] - 1]) - 1];
				}
			}

			// 按“状态焦虑”得到“诊断结果”
			// 按“状态焦虑”得到“指导意见”
			int[] intValueA = { 49, 59, 69 };
			String[] strValueA = { "目前无焦虑状态", "目前处于（轻度）焦虑状态", "目前处于（中度）焦虑状态", "目前处于（重度）焦虑状态" };
			String vAppraise = strValueA[strValueA.length - 1];
			String vDoctorIdea = "Stai1.1.4";

			for (i = 0; i < intValueA.length; i++) {
				if (vFactor <= intValueA[i]) {
					vAppraise = strValueA[i];
					vDoctorIdea = "Stai1.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Stai1 stai1 = new ClsScore.Stai1();

			stai1.setTotal_o(vFactor);
			stai1.setTotal_a(vAppraise);
			stai1.setTotal_d(vDoctorIdea);

			result.setObject(stai1);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 二十四、焦虑习性调查（Stai2）共20题 ****
	private static ClsAnswerResult GetStai2FactorScore(ClsAnswerRequest answer) {
		// 特质焦虑
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 20;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共二组，第一组1,2,3,4，第二组4,3,2,1
			int[][] intNumberA = { { 2, 5, 8, 9, 11, 12, 15, 17, 18, 20 }, { 1, 3, 4, 6, 7, 10, 13, 14, 16, 19 } };
			int[][] intScoreA = { { 1, 2, 3, 4 }, { 4, 3, 2, 1 } };

			int vFactor = 0; // 实际为1个因子

			// 特质焦虑
			for (i = 0; i < intNumberA.length; i++) {
				for (j = 0; j < intNumberA[0].length; j++) {
					vFactor += intScoreA[i][Integer.valueOf(sAnswer[intNumberA[i][j] - 1]) - 1];
				}
			}
			// 按“特质焦虑”得到“诊断结果”
			// 按“特质焦虑”得到“指导意见”
			int[] intValueA = { 49, 59, 69 };
			String[] strValueA = { "通常无焦虑特质", "通常有（轻度）焦虑特质", "通常有（中度）焦虑特质", "通常有（重度）焦虑特质" };
			String vAppraise = strValueA[strValueA.length - 1];
			String vDoctorIdea = "Stai2.1.4";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactor <= intValueA[i]) {
					vAppraise = strValueA[i];
					vDoctorIdea = "Stai2.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Stai2 stai2 = new ClsScore.Stai2();

			stai2.setTotal_o(vFactor);
			stai2.setTotal_a(vAppraise);
			stai2.setTotal_d(vDoctorIdea);

			result.setObject(stai2);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 二十五、汉密顿焦虑量表（Hama）共14题 **
	private static ClsAnswerResult GetHamaFactorScore(ClsAnswerRequest answer) {
		// 1总分，2躯体化焦虑，3精神化焦虑
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 14;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共一组0,1,2,3,4
			// “总分”为所有因子相加
			int[][] intNumberA = { { 7, 8, 9, 10, 11, 12, 13 }, { 1, 2, 3, 4, 5, 6, 14 } };

			int[] vFactorA = new int[3]; // 实际为3个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			// 原始分
			for (i = 0; i < intNumberA.length; i++) {
				for (j = 0; j < intNumberA[0].length; j++) {
					vFactorA[i + 1] += Integer.valueOf(sAnswer[intNumberA[i][j] - 1]) - 1;
				}
				// 总粗分
				vFactorA[0] += vFactorA[i + 1];
			}

			// 按“总粗分”得到“诊断结果”
			// 按“总粗分”得到“指导意见”
			int[] intValueA = { 6, 13, 20, 28 };
			String[] strValueA = { "没有焦虑症状", "可能有焦虑症状", "肯定有焦虑症状", "可能有明显焦虑症状", "可能有严重焦虑症状" };
			String vAppraise = strValueA[strValueA.length - 1];
			String vDoctorIdea = "Hama.1.5";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactorA[0] <= intValueA[i]) {
					vAppraise = strValueA[i];
					vDoctorIdea = "Hama.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Hama hama = new ClsScore.Hama();

			hama.setTotal_o(vFactorA[0]);
			hama.setTotal_a(vAppraise);
			hama.setTotal_d(vDoctorIdea);

			hama.setQth_o(vFactorA[1]);
			hama.setJsh_o(vFactorA[2]);

			result.setObject(hama);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 二十六、贝克焦虑量表（Bai）共21题
	private static ClsAnswerResult GetBaiFactorScore(ClsAnswerRequest answer) {
		// 粗分，标准分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 21;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;
			// 共一组，1,2,3,4

			float[][] vFactorA = new float[1][2]; // 实际为1个因子
			for (i = 0; i < vFactorA.length; i++) {
				for (j = 0; j < vFactorA[0].length; j++) {
					vFactorA[i][j] = 0;
				}
			}
			// 粗分
			for (i = 0; i < sAnswer.length; i++) {
				vFactorA[0][0] += Integer.valueOf(sAnswer[i]);
			}
			// 标准分
			BigDecimal bg = new BigDecimal(vFactorA[0][0] * 1.19);
			vFactorA[0][1] = bg.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();

			// 按“标准分”得到“诊断结果”
			// 按“标准分”得到“指导意见”
			String vAppraise = "";
			String vDoctorIdea = "";
			if (vFactorA[0][1] < 45) {
				vAppraise = "无焦虑症状";
				vDoctorIdea = "Bai.1.1";
			} else {
				vAppraise = "有焦虑症状";
				vDoctorIdea = "Bai.1.2";
			}

			ClsScore.Bai bai = new ClsScore.Bai();

			bai.setTotal_o(vFactorA[0][0]);
			bai.setTotal_s(vFactorA[0][1]);
			bai.setTotal_a(vAppraise);
			bai.setTotal_d(vDoctorIdea);

			result.setObject(bai);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// ☆二十七、社交焦虑量表（Lsas）共24题，有48个答案
	private static ClsAnswerResult GetLsasFactorScore(ClsAnswerRequest answer) {
		// 1害怕/焦虑总分，2回避总分，3合计总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 48;

			int intI;
			// 转换回原来格式
			String[] strTemp = answer.getAnswer().split("\\|");
			for (intI = 0; intI < strTemp.length; intI++) {
				if (strTemp[intI].equals("1")) {
					strTemp[intI] = "1&1";
				}
			}

			StringBuilder strAnswerTemp = new StringBuilder();
			for (intI = 0; intI < strTemp.length; intI++) {
				strAnswerTemp.append(strTemp[intI]).append("|");
			}

			if (!strAnswerTemp.toString().isEmpty()) {
				strAnswerTemp = new StringBuilder(strAnswerTemp.substring(0, strAnswerTemp.length() - 1).replaceAll("&", "|"));
			}

			String[] strAnswer_c = strAnswerTemp.toString().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i;
			// 有两排选择项，第一排4个，1,2,3,4；第二排4个，1,2,3,4
			int[] vFactorA = new int[3]; // 实际为3个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			// 原始分
			for (i = 0; i < sAnswer.length; i = i + 2) {
				vFactorA[0] += Integer.valueOf(sAnswer[i]) - 1;
				vFactorA[1] += Integer.valueOf(sAnswer[i + 1]) - 1;
			}
			vFactorA[2] = vFactorA[0] + vFactorA[1];

			// 按原始分得到“诊断结果”
			int[] intValueA = { 26, 49 };
			String[] strValueA = { "正常", "有社交焦虑", "有较严重的社交焦虑障碍" };
			String vAppraise = strValueA[strValueA.length - 1];
			for (i = 0; i < intValueA.length; i++) {
				if (vFactorA[2] <= intValueA[i]) {
					vAppraise = strValueA[i];
					break;
				}
			}

			ClsScore.Lsas lsas = new ClsScore.Lsas();

			lsas.setHp_o(vFactorA[0]);
			lsas.setHb_o(vFactorA[1]);
			lsas.setTotal_o(vFactorA[2]);
			lsas.setTotal_a(vAppraise);

			result.setObject(lsas);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 二十八、惧怕否定评价量表（Fne）共12题
	private static ClsAnswerResult GetFneFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 12;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共2组，第一组1,2,3,4,5，第二组5,4,3,2,1
			String[] strNumberA = { "1,3,5,6,8,9,11,12", "2,4,7,10" };
			String[] strSubA;
			int[][] intScoreA = { { 1, 2, 3, 4, 5 }, { 5, 4, 3, 2, 1 } };

			int vFactor = 0; // 实际为1个因子

			// 原始分
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactor += intScoreA[i][Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]) - 1];
				}
			}

			int[] intValueA = { 36, 44, 52 };
			String[] strValueA = { "正常范围", "轻度惧怕否定", "中度惧怕否定", "重度惧怕否定" };
			String vAppraise = strValueA[strValueA.length - 1];
			String vDoctorIdea = "Fne.1.4";

			for (i = 0; i < intValueA.length; i++) {
				if (vFactor <= intValueA[i]) {
					// 按原始分得到“诊断结果”
					vAppraise = strValueA[i];
					// 按原始分得到“指导意见”
					vDoctorIdea = "Fne.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Fne fne = new ClsScore.Fne();

			fne.setTotal_o(vFactor);
			fne.setTotal_a(vAppraise);
			fne.setTotal_d(vDoctorIdea);

			result.setObject(fne);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 二十九、艾森克情绪稳定性测验（Ask）共210题
	private static ClsAnswerResult GetAskFactorScore(ClsAnswerRequest answer) {
		// 1自卑感，2抑郁性，3焦虑，4强迫状态，5自主性，6疑心病，7负罪感
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 210;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j, k;

			// 共三组，第一组1,0,0，第二组0,0.5,0，第三组0,0,1
			String[][] strNumberA = { { "1,29,57,64,71,106,148,155,197,204", "16,23,30,37,51,79,121,128,142,177,205",
					"3,24,31,38,45,52,59,73,80,101,108,115,129,136,143,150,164,171,178,185,192,199,206",
					"4,11,18,25,32,39,46,53,60,67,74,81,88,95,102,109,130,137,144,151,158,165,172,179,186,193,200,207",
					"12,19,33,75,89,96,131,138,180",
					"13,20,27,34,41,48,55,62,69,76,83,90,97,111,118,125,132,139,146,153,160,174,181,188,195,202,209",
					"7,14,21,28,35,42,49,56,63,77,84,91,98,105,112,119,126,133,140,154,161,168,175,182,189,196,203" },
					{ "1,8,15,22,29,36,43,50,57,64,71,78,85,92,99,106,113,120,127,134,141,148,155,162,169,176,183,190,197,204",
							"2,9,16,23,30,37,44,51,58,65,72,79,86,93,100,107,114,121,128,135,142,149,156,163,170,177,184,191,198,205",
							"3,10,17,24,31,38,45,52,59,66,73,80,87,94,101,108,115,122,129,136,143,150,157,164,171,178,185,192,199,206",
							"4,11,18,25,32,39,46,53,60,67,74,81,88,95,102,109,116,123,130,137,144,151,158,165,172,179,186,193,200,207",
							"5,12,19,26,33,40,47,54,61,68,75,82,89,96,103,110,117,124,131,138,145,152,159,166,173,180,187,194,201,208",
							"6,13,20,27,34,41,48,55,62,69,76,83,90,97,104,111,118,125,132,139,146,153,160,167,174,181,188,195,202,209",
							"7,14,21,28,35,42,49,56,63,70,77,84,91,98,105,112,119,126,133,140,149,154,161,168,175,182,189,196,203,210" },
					{ "8,15,22,36,43,50,78,85,92,99,113,120,127,134,141,162,169,176,183,190",
							"2,9,44,58,65,72,86,93,100,107,114,135,149,156,163,170,184,191,198",
							"10,17,66,87,94,122,157", "116,123",
							"5,26,40,47,54,61,68,82,103,110,117,124,145,152,159,166,173,187,194,201,208", "6,104,167",
							"70,147,210" } };
			String[] strSubA;
			float[][] sngScoreA = { { 1f, 0f, 0f }, { 0f, 0.5f, 0f }, { 0f, 0f, 1f } };

			// 按原始分得到“指导意见”
			String[] vDoctorIdeaA = new String[7];

			float[] vFactorA = new float[7]; // 实际为7个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			// 原始分
			for (i = 0; i < strNumberA.length; i++) {
				for (j = 0; j < strNumberA[0].length; j++) {
					strSubA = strNumberA[i][j].split(",");
					for (k = 0; k < strSubA.length; k++) {
						vFactorA[j] += sngScoreA[i][Integer.valueOf(sAnswer[Integer.valueOf(strSubA[k]) - 1]) - 1];
					}
				}

			}

			// 按原始分得到“指导意见”
			int[][] intValueA = { { 8, 14, 21, 26 }, { 8, 14, 22, 26 }, { 7, 15, 23, 28 }, { 4, 9, 15, 22 },
					{ 7, 14, 20, 25 }, { 3, 5, 14, 20 }, { 3, 7, 14, 21 } };
			for (i = 0; i < intValueA.length; i++) {
				vDoctorIdeaA[i] = "Ask." + String.valueOf(i + 1) + ".5";
				for (j = 0; j < intValueA[0].length; j++) {
					if (vFactorA[i] <= intValueA[i][j]) {
						vDoctorIdeaA[i] = "Ask." + String.valueOf(i + 1) + "." + String.valueOf(j + 1);
						break;
					}
				}
			}

			ClsScore.Ask ask = new ClsScore.Ask();

			ask.setZbg_o(vFactorA[0]);
			ask.setZbg_d(vDoctorIdeaA[0]);

			ask.setYyx_o(vFactorA[1]);
			ask.setYyx_d(vDoctorIdeaA[1]);

			ask.setJl_o(vFactorA[2]);
			ask.setJl_d(vDoctorIdeaA[2]);

			ask.setQbzt_o(vFactorA[3]);
			ask.setQbzt_d(vDoctorIdeaA[3]);

			ask.setZzx_o(vFactorA[4]);
			ask.setZzx_d(vDoctorIdeaA[4]);

			ask.setYxb_o(vFactorA[5]);
			ask.setYxb_d(vDoctorIdeaA[5]);

			ask.setFzg_o(vFactorA[6]);
			ask.setFzg_d(vDoctorIdeaA[6]);

			result.setObject(ask);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 三十、社交回避及苦恼量表（Sad）共28题
	private static ClsAnswerResult GetSadFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 28;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共2组，第一组0,1，第二组1,0
			int[][] intNumberA = { { 1, 3, 4, 6, 7, 9, 12, 15, 17, 19, 22, 25, 27, 28 },
					{ 2, 5, 8, 10, 11, 13, 14, 16, 18, 20, 21, 23, 24, 26 } };
			int[][] intScoreA = { { 0, 1 }, { 1, 0 } };

			int vFactor = 0; // 实际为1个因子

			// 原始分
			// 总分
			for (i = 0; i < intNumberA.length; i++) {
				for (j = 0; j < intNumberA[0].length; j++) {
					vFactor += intScoreA[i][Integer.valueOf(sAnswer[intNumberA[i][j] - 1]) - 1];
				}
			}

			// 按原始分“指导意见”
			int[] intValueA = { 13, 17, 21 };
			String vDoctorIdea = "Sad.1.4";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactor <= intValueA[i]) {
					vDoctorIdea = "Sad.1." + Integer.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Sad sad = new ClsScore.Sad();

			sad.setTotal_o(vFactor);
			sad.setTotal_d(vDoctorIdea);

			result.setObject(sad);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 三十一、情绪—社交孤独问卷（Esli）共30题
	private static ClsAnswerResult GetEsliFactorScore(ClsAnswerRequest answer) {
		// 1情绪孤立，2社交孤立，3情绪孤独，4社交孤独
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 30;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共一组，0,1,2,3
			int[] intNumberA = { 8, 15, 23, 30 };
			int intLocal = 0;

			// 按原始分得到“指导意见”
			String[] vDoctorIdeaA = new String[4];

			int[] vFactorA = new int[4]; // 实际为4个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			// 原始分
			for (i = 0; i < sAnswer.length; i++) {
				vFactorA[intLocal] += Integer.valueOf(sAnswer[i]) - 1;
				if (i >= (intNumberA[intLocal] - 1)) {
					intLocal += 1;
				}
			}

			// 按原始分得到“指导意见”
			int[][] intValueA = { { 6, 9, 13 }, { 6, 9, 13 }, { 6, 11, 15 }, { 5, 10, 14 } };
			for (i = 0; i < intValueA.length; i++) {
				vDoctorIdeaA[i] = "Esli." + String.valueOf(i + 1) + ".4";
				for (j = 0; j < intValueA[0].length; j++) {
					if (vFactorA[i] < intValueA[i][j]) {
						vDoctorIdeaA[i] = "Esli." + String.valueOf(i + 1) + "." + String.valueOf(j + 1);
						break;
					}
				}
			}

			ClsScore.Esli esli = new ClsScore.Esli();

			esli.setQxgl_o(vFactorA[0]);
			esli.setQxgl_d(vDoctorIdeaA[0]);

			esli.setSjgl_o(vFactorA[1]);
			esli.setSjgl_d(vDoctorIdeaA[1]);

			esli.setQxgd_o(vFactorA[2]);
			esli.setQxgd_d(vDoctorIdeaA[2]);

			esli.setSjgd_o(vFactorA[3]);
			esli.setSjgd_d(vDoctorIdeaA[3]);

			result.setObject(esli);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 三十二、医院焦虑抑郁量表（Hads）共14题 ****
	private static ClsAnswerResult GetHadsFactorScore(ClsAnswerRequest answer) {
		// 1焦虑总分，2抑郁总分，3总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 14;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j, k;

			// 共两组，第一组0,1,2,3，第二组3,2,1,0
			String[][] strNumberA = { { "1,3,5,9,11", "6,8,12" }, { "7,13", "2,4,10,14" } };
			String[] strSubA;
			int[][] intScoreA = { { 3, 2, 1, 0 }, { 0, 1, 2, 3 } };

			String[] vAppraiseA = new String[3]; // 按原始分得到“诊断结果”

			int[] vFactorA = new int[3]; // 实际为3个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			// 原始分
			for (i = 0; i < strNumberA.length; i++) {
				for (j = 0; j < strNumberA[0].length; j++) {
					strSubA = strNumberA[i][j].split(",");
					for (k = 0; k < strSubA.length; k++) {
						vFactorA[j] += intScoreA[i][Integer.valueOf(sAnswer[Integer.valueOf(strSubA[k]) - 1]) - 1];
					}
				}
			}
			vFactorA[2] = vFactorA[0] + vFactorA[1];

			// 按原始分得到“诊断结果”
			int[] intValueA = { 8, 10 };
			String[][] strValueA = { { "无焦虑症状", "焦虑症状可疑", "有焦虑症状" }, { "无抑郁症状", "抑郁症状可疑", "有抑郁症状" } };
			for (i = 0; i < strValueA.length; i++) {
				vAppraiseA[i] = strValueA[i][strValueA[0].length - 1];
				for (j = 0; j < intValueA.length; j++) {
					if (vFactorA[i] <= intValueA[j]) {
						vAppraiseA[i] = strValueA[i][j];
						break;
					}
				}
			}

			ClsScore.Hads hads = new ClsScore.Hads();

			hads.setJl_o(vFactorA[0]);
			hads.setJl_a(vAppraiseA[0]);

			hads.setYy_o(vFactorA[1]);
			hads.setYy_a(vAppraiseA[1]);

			hads.setTotal_o(vFactorA[2]);

			result.setObject(hads);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 三十三、精神状态全面量表（Cprs）共67题
	private static ClsAnswerResult GetCprsFactorScore(ClsAnswerRequest answer) {
		// 1总分，2精神分裂症分量表总分，3抑郁症分量表总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 67;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共一组分二个因子，0,1,2,3
			String[] strNumberA = { "1,3,5,6,13,16,19,28,29,30,31,33,36,37,38,40,45,50,54,55,57",
					"1,3,5,6,7,9,13,14,15,16,18,19,23,25,41,61,63" };
			String[] strSubA;

			int[] vFactorA = new int[3]; // 实际为3个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			// 原始分
			// 总分
			for (i = 0; i < sAnswer.length; i++) {
				vFactorA[0] += Integer.valueOf(sAnswer[i]) - 1;
			}
			// 后2个因子
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactorA[i + 1] += Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]) - 1;
				}
			}

			ClsScore.Cprs cprs = new ClsScore.Cprs();

			cprs.setTotal_o(vFactorA[0]);
			cprs.setJsfl_o(vFactorA[1]);
			cprs.setYyz_o(vFactorA[2]);

			result.setObject(cprs);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 三十四、简明精神病量表（Bprs）共18题
	private static ClsAnswerResult GetBprsFactorScore(ClsAnswerRequest answer) {
		// 1总粗分，2焦虑忧郁，3缺乏活力，4思维障碍，5激活性，6敌对猜疑
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 18;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// “总粗分”可以由其它因子相加得到
			// 后的2-6的因子，共一组，1,2,3,4,5,6,7
			String[] strNumberA = { "1,2,5,9", "3,13,16,18", "4,8,12,15", "6,7,17", "10,11,14" };
			String[] strSubA;

			// 按平均分得到“诊断结果”，2-6因子
			String[] vAppraiseA = new String[6];

			float[][] vFactorA = new float[6][2]; // 实际为6个因子
			for (i = 0; i < vFactorA.length; i++) {
				for (j = 0; j < vFactorA[0].length; j++) {
					vFactorA[i][j] = 0;
				}
			}

			// 原始分
			// 2-6的因子
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactorA[i + 1][0] += Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]);
				}
				// 平均分
				// vFactorA(i + 1, 1) = Math.Round(vFactorA(i + 1, 0) /
				// (strSubA.GetUpperBound(0) + 1), 2)
				BigDecimal bg = new BigDecimal(vFactorA[i + 1][0] / (strSubA.length));
				vFactorA[i + 1][1] = bg.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
				// 1总粗分
				vFactorA[0][0] += vFactorA[i + 1][0];
			}

			// 按2-6因子的平均分得到“诊断结果”
			int[] intValueA = { 1, 2, 3, 4, 5, 6 };
			String[] strValueA = { "无症状", "可疑或很轻", "轻度", "中度", "偏重", "重度", "极重" };
			for (i = 1; i < 6; i++) {
				vAppraiseA[i] = strValueA[strValueA.length - 1];
				for (j = 0; j < intValueA.length; j++) {
					if (vFactorA[i][1] <= intValueA[j]) {
						vAppraiseA[i] = strValueA[j];
						break;
					}
				}
			}

			ClsScore.Bprs bprs = new ClsScore.Bprs();

			bprs.setTotal_o(vFactorA[0][0]);
			bprs.setJlyy_o(vFactorA[1][0]);
			bprs.setJlyy_ave(vFactorA[1][1]);
			bprs.setJlyy_a(vAppraiseA[1]);
			bprs.setQfhl_o(vFactorA[2][0]);
			bprs.setQfhl_ave(vFactorA[2][1]);
			bprs.setQfhl_a(vAppraiseA[2]);
			bprs.setSwza_o(vFactorA[3][0]);
			bprs.setSwza_ave(vFactorA[3][1]);
			bprs.setSwza_a(vAppraiseA[3]);
			bprs.setJhx_o(vFactorA[4][0]);
			bprs.setJhx_ave(vFactorA[4][1]);
			bprs.setJhx_a(vAppraiseA[4]);
			bprs.setDdcy_o(vFactorA[5][0]);
			bprs.setDdcy_ave(vFactorA[5][1]);
			bprs.setDdcy_a(vAppraiseA[5]);

			result.setObject(bprs);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 三十五、躁狂量表（Brms）共13题 **
	private static ClsAnswerResult GetBrmsFactorScore(ClsAnswerRequest answer) {
		// 1总分，2幻觉，3妄想
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 13;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i;
			// 共一组0,1,2,3,4

			int[] vFactorA = new int[3]; // 实际为3个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			// 总分
			for (i = 0; i < 11; i++) {
				vFactorA[0] += Integer.valueOf(sAnswer[i]) - 1;
			}
			// 幻觉12
			vFactorA[1] = Integer.valueOf(sAnswer[11]) - 1;
			// 妄想13
			vFactorA[2] = Integer.valueOf(sAnswer[12]) - 1;

			// 按“总分”得到“诊断结果”
			// 按“总分”得到“指导意见”
			int[] intValueA = { 5, 10, 22 };
			String[] strValueA = { "无明显躁狂症状", "有躁狂症状", "有一定严重程度的躁狂症状", "有严重的躁狂症状" };
			String vAppraise = strValueA[strValueA.length - 1];
			String vDoctorIdea = "Brms.1.4";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactorA[0] <= intValueA[i]) {
					vAppraise = strValueA[i];
					vDoctorIdea = "Brms.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Brms brms = new ClsScore.Brms();

			brms.setTotal_o(vFactorA[0]);
			brms.setTotal_a(vAppraise);
			brms.setTotal_d(vDoctorIdea);
			brms.setHj_o(vFactorA[1]);
			brms.setWx_o(vFactorA[2]);

			result.setObject(brms);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 三十六、阴性症状量表（Sans）共24题 **
	private static ClsAnswerResult GetSansFactorScore(ClsAnswerRequest answer) {
		// 1总分，2分量表综合评价总分，3情形平淡或迟钝综合评价，4思维贫乏综合评价，5意志缺乏综合评价，6兴趣／社交缺乏综合评价，7注意障碍综合评价
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 24;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i;
			// 共一组0,1,2,3,4,5
			int[] intNumberA = { 7, 12, 16, 21, 24 };

			int[] vFactorA = new int[7]; // 实际为7个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			// 总分
			for (i = 0; i < sAnswer.length; i++) {
				vFactorA[0] += Integer.valueOf(sAnswer[i]) - 1;
			}

			// 分量表综合评价总分
			for (i = 0; i < intNumberA.length; i++) {
				vFactorA[1] += Integer.valueOf(sAnswer[intNumberA[i] - 1]) - 1;
			}

			// 情形平淡或迟钝综合评价7
			vFactorA[2] = Integer.valueOf(sAnswer[6]) - 1;
			// 思维贫乏综合评价12
			vFactorA[3] = Integer.valueOf(sAnswer[11]) - 1;
			// 意志缺乏综合评价16
			vFactorA[4] = Integer.valueOf(sAnswer[15]) - 1;
			// 兴趣 / 社交缺乏综合评价21
			vFactorA[5] = Integer.valueOf(sAnswer[20]) - 1;
			// 注意障碍综合评价24
			vFactorA[6] = Integer.valueOf(sAnswer[23]) - 1;

			// 按后5个因子得到“诊断结果”
			String[] strValueA = { "情感平淡", "思维贫乏", "意志缺乏", "兴趣/社交缺乏", "注意障碍" };
			String vAppraise = "";
			for (i = 0; i < strValueA.length; i++) {
				if (vFactorA[i + 2] >= 3) {
					vAppraise += strValueA[i] + "、";
				}
			}
			if (vAppraise.length() > 0) {
				vAppraise = vAppraise.substring(0, vAppraise.length() - 1);
			} else {
				vAppraise = "无";
			}

			// 按“总分”得到“指导意见”
			int[] intValueA = { 85, 55, 25 };
			String vDoctorIdea = "";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactorA[0] >= intValueA[i]) {
					vDoctorIdea = "Sans.1." + String.valueOf(3 - i);
					break;
				}

			}

			ClsScore.Sans sans = new ClsScore.Sans();

			sans.setTotal_o(vFactorA[0]);
			sans.setFlb_o(vFactorA[1]);
			sans.setQxpd_o(vFactorA[2]);
			sans.setSwpf_o(vFactorA[3]);
			sans.setYzqf_o(vFactorA[4]);
			sans.setXq_o(vFactorA[5]);
			sans.setZyza_o(vFactorA[6]);
			sans.setTcyx_a(vAppraise);
			sans.setTotal_d(vDoctorIdea);

			result.setObject(sans);

			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 三十七、阳性症状量表（Saps）共34题 **
	private static ClsAnswerResult GetSapsFactorScore(ClsAnswerRequest answer) {
		// 1总分，2分量表综合评价总分，3幻觉综合评价，4妄想综合评价，5怪异行为综合评价，6阳性思维形式障碍综合评价
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 34;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i;

			// 共一组0,1,2,3,4,5
			int[] intNumberA = { 7, 20, 25, 34 };
			int[] vFactorA = new int[6]; // 实际为6个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}
			// 总分
			for (i = 0; i < sAnswer.length; i++) {
				vFactorA[0] += Integer.valueOf(sAnswer[i]) - 1;
			}

			// 分量表综合评价总分
			for (i = 0; i < intNumberA.length; i++) {
				vFactorA[1] += Integer.valueOf(sAnswer[intNumberA[i] - 1]) - 1;
			}
			// 幻觉综合评价7
			vFactorA[2] = Integer.valueOf(sAnswer[6]) - 1;
			// 妄想综合评价20
			vFactorA[3] = Integer.valueOf(sAnswer[19]) - 1;
			// 怪异行为综合评价25
			vFactorA[4] = Integer.valueOf(sAnswer[24]) - 1;
			// 阳性思维形式障碍综合评价34
			vFactorA[5] = Integer.valueOf(sAnswer[33]) - 1;

			// 按后5个因子得到“诊断结果”
			String[] strValueA = { "幻觉", "妄想", "怪异行为", "阳性思维形式障碍" };
			String vAppraise = "";
			for (i = 0; i < strValueA.length; i++) {
				if (vFactorA[i + 2] >= 3) {
					vAppraise += strValueA[i] + ",";
				}
			}

			if (vAppraise.length() > 0) {
				vAppraise = vAppraise.substring(0, vAppraise.length() - 1);
			} else {
				vAppraise = "无";
			}

			// 按“总分”得到“指导意见”
			int[] intValueA = { 119, 77, 35 };
			String vDoctorIdea = "";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactorA[0] >= intValueA[i]) {
					vDoctorIdea = "Saps.1." + String.valueOf(3 - i);
					break;
				}
			}

			ClsScore.Saps saps = new ClsScore.Saps();

			saps.setTotal_o(vFactorA[0]);
			saps.setFlb_o(vFactorA[1]);
			saps.setHj_o(vFactorA[2]);
			saps.setWx_o(vFactorA[3]);
			saps.setGyxw_o(vFactorA[4]);
			saps.setYxsw_o(vFactorA[5]);
			saps.setTcyx_a(vAppraise);
			saps.setTotal_d(vDoctorIdea);

			result.setObject(saps);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// ☆三十八、副反应量表（Tess）共36题，有两题用@@存储
	private static ClsAnswerResult GetTessFactorScore(ClsAnswerRequest answer) {
		// 1行为毒性，2化验异常，3神经系，4植物神经系统，5心血管系，6其它，7总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 72;

			int intI;
			// 转换回原来格式
			String[] strTemp1 = answer.getAnswer().split("\\|@");
			String strTemp2 = strTemp1[0] + "|" + strTemp1[1].split(",")[1].toString() + "|"
					+ strTemp1[2].split(",")[1].toString() + "@@" + strTemp1[1].split(",")[0].toString() + "@@"
					+ strTemp1[2].split(",")[0].toString();

			// 临时赋值，JAVA默认切割时为空就不增加数组长度
			String[] strAnswer_c_Temp = strTemp2.replaceAll("&", "\\|").split(g_sChar);
			String[] strAnswer_c = { "", "", "" };
			for (intI = 0; intI < strAnswer_c_Temp.length; intI++) {
				strAnswer_c[intI] = strAnswer_c_Temp[intI].trim();
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// “总分”可以由其它因子相加得到
			// 共二组，第一组0,1,2,3,4，第二组0,1,2,3,4,5
			int[] intNumberA = { 0, 7, 10, 14, 22, 27, 33, 36 };

			// 按“选项”得到“诊断结果”
			String[] vAppraiseA = new String[4];

			float[][] vFactorA = new float[7][4]; // 实际为7个因子，严重程度：原始分，均分；处理：原始分，均分
			for (i = 0; i < vFactorA.length; i++) {
				for (j = 0; j < vFactorA[0].length; j++) {
					vFactorA[i][j] = 0;
				}
			}

			// 由于“答案”中可能有特殊的内容，要进行分割
			// 正确的应该分出三份内容，第一份是答案，其他二份分别是“题34的内容”，“题35的内容”
			// 原始分
			int intLocal = 0;
			for (i = 0; i < sAnswer.length; i += 2) {
				if (i >= 66) // 34,35,36 不计分
				{
					break;
				}
				if ((i / 2 + 1) > intNumberA[intLocal + 1]) {
					// 严重程度：均分
					BigDecimal bg1 = new BigDecimal(
							vFactorA[intLocal][0] / (intNumberA[intLocal + 1] - intNumberA[intLocal]));
					vFactorA[intLocal][1] = bg1.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
					// 处理：均分
					BigDecimal bg2 = new BigDecimal(
							vFactorA[intLocal][2] / (intNumberA[intLocal + 1] - intNumberA[intLocal]));
					vFactorA[intLocal][3] = bg2.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
					intLocal += 1;
				}
				vFactorA[intLocal][0] += Integer.valueOf(sAnswer[i]) - 1;
				vFactorA[intLocal][2] += Integer.valueOf(sAnswer[i + 1]) - 1;
			}
			// 7总分
			for (i = 0; i < 6; i++) {
				vFactorA[6][0] += vFactorA[i][0];
				vFactorA[6][2] += vFactorA[i][2];
			}
			// 均分
			BigDecimal bg3 = new BigDecimal(vFactorA[6][0] / 33);
			vFactorA[6][1] = bg3.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();

			BigDecimal bg4 = new BigDecimal(vFactorA[6][2] / 33);
			vFactorA[6][3] = bg4.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();

			// 按“选项”得到“诊断结果”33,34
			String[] strValueA = { "无该项症状", "极轻或可疑", "轻度", "中度", "重度" };
			vAppraiseA[0] = strAnswer_c[1] + "，" + strValueA[Integer.valueOf(sAnswer[66]) - 1];
			vAppraiseA[1] = strAnswer_c[2] + "，" + strValueA[Integer.valueOf(sAnswer[68]) - 1];
			// 严重程度总评
			String[] strValueTwoA = { "无", "轻", "中", "重", "不肯定" };
			vAppraiseA[2] = strValueTwoA[Integer.valueOf(sAnswer[70]) - 1];
			vAppraiseA[3] = strValueTwoA[Integer.valueOf(sAnswer[71]) - 1];

			ClsScore.Tess tess = new ClsScore.Tess();

			tess.setXwdx_yz_o(vFactorA[0][0]);
			tess.setXwdx_yz_ave(vFactorA[0][1]);
			tess.setXwdx_cl_o(vFactorA[0][2]);
			tess.setXwdx_cl_ave(vFactorA[0][3]);

			tess.setHyyc_yz_o(vFactorA[1][0]);
			tess.setHyyc_yz_ave(vFactorA[1][1]);
			tess.setHyyc_cl_o(vFactorA[1][2]);
			tess.setHyyc_cl_ave(vFactorA[1][3]);

			tess.setSjx_yz_o(vFactorA[2][0]);
			tess.setSjx_yz_ave(vFactorA[2][1]);
			tess.setSjx_cl_o(vFactorA[2][2]);
			tess.setSjx_cl_ave(vFactorA[2][3]);

			tess.setZwsj_yz_o(vFactorA[3][0]);
			tess.setZwsj_yz_ave(vFactorA[3][1]);
			tess.setZwsj_cl_o(vFactorA[3][2]);
			tess.setZwsj_cl_ave(vFactorA[3][3]);

			tess.setXxg_yz_o(vFactorA[4][0]);
			tess.setXxg_yz_ave(vFactorA[4][1]);
			tess.setXxg_cl_o(vFactorA[4][2]);
			tess.setXxg_cl_ave(vFactorA[4][3]);

			tess.setOther_yz_o(vFactorA[5][0]);
			tess.setOther_yz_ave(vFactorA[5][1]);
			tess.setOther_cl_o(vFactorA[5][2]);
			tess.setOther_cl_ave(vFactorA[5][3]);

			tess.setTotal_yz_o(vFactorA[6][0]);
			tess.setTotal_yz_ave(vFactorA[6][1]);
			tess.setTotal_cl_o(vFactorA[6][2]);
			tess.setTotal_cl_ave(vFactorA[6][3]);

			tess.setAnswer34_a(vAppraiseA[0]);
			tess.setAnswer35_a(vAppraiseA[1]);
			tess.setYzcd_a(vAppraiseA[2]);
			tess.setTkcd_a(vAppraiseA[3]);

			result.setObject(tess);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 三十九、抗抑郁药副反应量表（Sers）共14题 **
	private static ClsAnswerResult GetSersFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 14;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i;
			// 共一组，0,1,2,3

			String[] vAppraiseA = new String[14]; // 按原始分得到“诊断结果”

			int vFactor = 0; // 实际为1个因子

			String[] strValueA = { "没有", "轻度", "中度", "重度" };

			// 总分
			for (i = 0; i < sAnswer.length; i++) {
				vFactor += Integer.valueOf(sAnswer[i]) - 1;
				// 按原始分得到“诊断结果”
				vAppraiseA[i] = strValueA[Integer.valueOf(sAnswer[i]) - 1];
			}

			int[] intValueA = { 30, 19, 8 };
			String vDoctorIdea = "";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactor >= intValueA[i]) {
					// 按原始分得到“指导意见”
					vDoctorIdea = "Sers.1." + String.valueOf(3 - i);
					break;
				}
			}

			ClsScore.Sers sers = new ClsScore.Sers();

			sers.setStpj_a(vAppraiseA[0]);
			sers.setTt_a(vAppraiseA[1]);
			sers.setSmza_a(vAppraiseA[2]);
			sers.setTy_a(vAppraiseA[3]);
			sers.setZlxxt_a(vAppraiseA[4]);
			sers.setXj_a(vAppraiseA[5]);
			sers.setZc_a(vAppraiseA[6]);
			sers.setCh_a(vAppraiseA[7]);
			sers.setKg_a(vAppraiseA[8]);
			sers.setBm_a(vAppraiseA[9]);
			sers.setPnza_a(vAppraiseA[10]);
			sers.setSs_a(vAppraiseA[11]);
			sers.setXgnza_a(vAppraiseA[12]);
			sers.setQtzz_a(vAppraiseA[13]);

			sers.setTotal_o(vFactor);
			sers.setTotal_d(vDoctorIdea);

			result.setObject(sers);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 四十、锥体外系副反应量表（Reses）共10题 **
	private static ClsAnswerResult GetResesFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 10;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i;
			// 共一组，0,1,2,3,4

			int vFactor = 0; // 实际为1个因子

			// 总分
			for (i = 0; i < sAnswer.length; i++) {
				vFactor += Integer.valueOf(sAnswer[i]) - 1;
			}

			// 按总分得到“指导意见”
			int[] intValueA = { 30, 19, 8 };
			String vDoctorIdea = "";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactor >= intValueA[i]) {
					vDoctorIdea = "Reses.1." + String.valueOf(3 - i);
					break;
				}
			}

			ClsScore.Reses reses = new ClsScore.Reses();

			reses.setTotal_o(vFactor);
			reses.setTotal_d(vDoctorIdea);

			result.setObject(reses);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 四十一、日常生活能力量表（Adl）共14题
	private static ClsAnswerResult GetAdlFactorScore(ClsAnswerRequest answer) {
		// 1总分，2躯体生活自理，3工具性日常生活能力
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 14;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共一组分二个因子，1,2,3,4
			String[] strNumberA = { "2,6,7,8,10,12", "1,3,4,5,9,11,13,14" };
			String[] strSubA;
			// 附加计分
			int intAdded = 0;

			int[] vFactorA = new int[3]; // 实际为3个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			// 原始分
			// 后2个因子
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactorA[i + 1] += Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]);
					if (Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]) >= 3) {
						intAdded += 1; // 选3或4
					}
				}
				// 总分(由2个因子相加)
				vFactorA[0] += vFactorA[i + 1];
			}

			// “诊断结果”，按“总分”和“附加计分”得到
			String vAppraise = "明显功能障碍";
			if (vFactorA[0] < 15) {
				vAppraise = "无功能障碍";
			} else if (vFactorA[0] <= 21 && intAdded < 2) {
				vAppraise = "功能有一定程度的下降";
			}

			ClsScore.Adl adl = new ClsScore.Adl();

			adl.setTotal_o(vFactorA[0]);
			adl.setTotal_a(vAppraise);
			adl.setQtsh_o(vFactorA[1]);
			adl.setGjx_o(vFactorA[2]);

			result.setObject(adl);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 四十二、社会功能缺陷量表（Sdss）共10题
	private static ClsAnswerResult GetSdssFactorScore(ClsAnswerRequest answer) {
		// 1总分，职业和工作，婚姻职能，父母职能，社会性退缩，家庭外的社会活动，家庭内活动过少，家庭职能，个人生活自理，对外界的兴趣和关心，责任心和计划性
		// 实际只有一个因子“总分”
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 10;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}
			int i;

			// 共一组，0,1,2
			// 每个因子是一道题

			// 按原始分“诊断结果”
			String[] vAppraiseA = new String[11];
			int vFactor = 0; // 实际为1个因子

			// 原始分
			for (i = 0; i < 10; i++) {
				vFactor += Integer.valueOf(sAnswer[i]) - 1;
			}

			// “诊断结果”
			// “总分”
			vAppraiseA[0] = (vFactor < 2 ? "正常" : "有社会功能缺陷");// IIf(vFactor < 2,
			// "正常",
			// "有社会功能缺陷")

			// 10个题目
			for (i = 0; i < 10; i++) {
				vAppraiseA[i + 1] = "无";
				if (Integer.valueOf(sAnswer[i]) == 2) {
					vAppraiseA[i + 1] = "有功能缺陷";
				} else if (Integer.valueOf(sAnswer[i]) == 3) {
					vAppraiseA[i + 1] = "严重功能缺陷";
				}
			}

			ClsScore.Sdss sdss = new ClsScore.Sdss();

			sdss.setTotal_o(vFactor);
			sdss.setTotal_a(vAppraiseA[0]);
			sdss.setZyhgz_a(vAppraiseA[1]);
			sdss.setHyzn_a(vAppraiseA[2]);
			sdss.setFmzn_a(vAppraiseA[3]);
			sdss.setShx_a(vAppraiseA[4]);
			sdss.setJtw_a(vAppraiseA[5]);
			sdss.setJtn_a(vAppraiseA[6]);
			sdss.setJtzn_a(vAppraiseA[7]);
			sdss.setGrsh_a(vAppraiseA[8]);
			sdss.setDwj_a(vAppraiseA[9]);
			sdss.setZrx_a(vAppraiseA[10]);

			result.setObject(sdss);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 四十三、Yale—Brown强迫评定量表（YaleBrown），共10题 ****
	private static ClsAnswerResult GetYaleBrownFactorScore(ClsAnswerRequest answer) {
		// 1强迫思维计分，2强迫行为计分，3总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 10;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共一组，0,1,2,3,4
			int[][] intNumberA = { { 1, 2, 3, 4, 5 }, { 6, 7, 8, 9, 10 } };

			int[] vFactorA = new int[3]; // 实际为3个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}
			// 原始分
			for (i = 0; i < intNumberA.length; i++) {
				for (j = 0; j < intNumberA[0].length; j++) {
					vFactorA[i] += Integer.valueOf(sAnswer[intNumberA[i][j] - 1]) - 1;
				}
				vFactorA[2] += vFactorA[i];
			}

			// 按原始分得到“指导意见”
			int[] intValueA = { 4, 10, 20, 30 }; // 2006-08-21
			String vDoctorIdea = "YaleBrown.1.5";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactorA[2] <= intValueA[i]) {
					vDoctorIdea = "YaleBrown.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.YaleBrown yalebrown = new ClsScore.YaleBrown();

			yalebrown.setQpsw_o(vFactorA[0]);
			yalebrown.setQpxw_o(vFactorA[1]);
			yalebrown.setTotal_o(vFactorA[2]);
			yalebrown.setTotal_d(vDoctorIdea);

			result.setObject(yalebrown);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 四十四、护士用住院病人观察（Nosie）共30题 ****
	private static ClsAnswerResult GetNosieFactorScore(ClsAnswerRequest answer) {
		// 1社会能力，2社会兴趣，3个人整洁，4激怒，5迟缓，6抑郁，7精神病表现，8总积极因素，9总消极因素，10总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 30;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共一组，基本上都是0,1,2,3,4，实际为0,2,4,6,8
			String[] strNumberA = { "13,14,21,24,25", "4,9,15,17,19", "", "2,6,10,11,12,29", "5,22,27", "3,18,23",
					"7,20,26,28" };
			String[] strSubA;
			int[] intScoreA = { 0, 2, 4, 6, 8 };

			int[] vFactorA = new int[10]; // 实际为10个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			// 原始分
			for (i = 0; i < strNumberA.length; i++) {
				if (strNumberA[i].length() > 0) {
					strSubA = strNumberA[i].split(",");
					for (j = 0; j < strSubA.length; j++) {
						vFactorA[i] += intScoreA[Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]) - 1];
					}
				}
			}
			// 1社会能力
			vFactorA[0] = 40 - vFactorA[0];
			// 3个人整洁，8,30；1,16
			int[] intGrzjA = new int[2];
			int[][] intNumA = { { 8, 30 }, { 1, 16 } };
			for (i = 0; i < intNumA.length; i++) {
				for (j = 0; j < intNumA.length; j++) {
					intGrzjA[i] += Integer.valueOf(sAnswer[intNumA[i][j] - 1]) - 1;
				}
			}
			vFactorA[2] = (8 + intGrzjA[0] - intGrzjA[1]) * 2;
			// 8总积极因素
			vFactorA[7] = vFactorA[0] + vFactorA[1] + vFactorA[2];
			// 9总消极因素
			vFactorA[8] = vFactorA[3] + vFactorA[4] + vFactorA[5] + vFactorA[6];
			// 10总分
			vFactorA[9] = 128 + vFactorA[7] - vFactorA[8];

			ClsScore.Nosie nosie = new ClsScore.Nosie();

			nosie.setShnl_o(vFactorA[0]);
			nosie.setShxq_o(vFactorA[1]);
			nosie.setGrzj_o(vFactorA[2]);
			nosie.setJn_o(vFactorA[3]);
			nosie.setCh_o(vFactorA[4]);
			nosie.setYy_o(vFactorA[5]);
			nosie.setJsbbx_o(vFactorA[6]);
			nosie.setZjjys_o(vFactorA[7]);
			nosie.setZxjys_o(vFactorA[8]);
			nosie.setTotal_o(vFactorA[9]);

			result.setObject(nosie);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 四十五、密西根酒精调查表（Mast）共25题 ****
	private static ClsAnswerResult GetMastFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 25;

			int intI;
			// 转换回原来格式
			String[] strTemp1 = answer.getAnswer().split(g_nChar);
			String[] strAnswer24 = { "", "" };
			String[] strAnswer25 = { "", "" };
			String[] strTemp24 = strTemp1[23].split("&@");
			String[] strTemp25 = strTemp1[24].split("&@");

			String strTemp = "";

			for (intI = 0; intI < strTemp24.length; intI++) {
				strAnswer24[intI] = strTemp24[intI].trim();
			}
			for (intI = 0; intI < strTemp25.length; intI++) {
				strAnswer25[intI] = strTemp25[intI].trim();
			}

			for (intI = 0; intI < strTemp1.length - 2; intI++) {
				strTemp += strTemp1[intI] + "|";
			}

			strTemp += strAnswer24[0] + "|" + strAnswer25[0] + "@@" + strAnswer24[1] + "@@" + strAnswer25[1];

			// 临时赋值，JAVA默认切割时为空就不增加数组长度
			String[] strAnswer_c_Temp = strTemp.split(g_sChar);
			String[] strAnswer_c = { "", "", "" };
			for (intI = 0; intI < strAnswer_c_Temp.length; intI++) {
				strAnswer_c[intI] = strAnswer_c_Temp[intI].trim();
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共五组，第一组0,2，第二组5,0，第三组1,0，第四组5,2，第五组2,0
			String[] strNumberA = { "2,5,7,8", "9", "4,6,10,17", "19", "3,11,12,13,14,15,16,18,20,21,22,23" };
			String[] strSubA;
			int[][] intScoreA = { { 0, 2 }, { 5, 0 }, { 1, 0 }, { 5, 2 }, { 2, 0 } };

			int vFactor = 0; // 实际为1个因子

			// 总分
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactor += intScoreA[i][Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]) - 1];
				}
			}

			// 按总分得到“诊断结果”
			int[] intValueA = { 0, 4, 6, 25, 39 };
			String[] strValueA = { "无", "低", "轻", "中度", "较重", "严重" };
			String vAppraise = strValueA[strValueA.length - 1];
			for (i = 0; i < intValueA.length; i++) {
				if (vFactor <= intValueA[i]) {
					vAppraise = strValueA[i];
					break;
				}
			}

			ClsScore.Mast mast = new ClsScore.Mast();

			mast.setTotal_o(vFactor);
			mast.setTotal_a(vAppraise);

			result.setObject(mast);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 四十六、老年临床评定量表（Scap）共19题 ****
	private static ClsAnswerResult GetScapFactorScore(ClsAnswerRequest answer) {
		// 1总分，2总体印象分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 19;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i;
			// 共一组，1,2,3,4,5

			int[] vFactorA = new int[2]; // 实际为2个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			// 1总分
			for (i = 0; i < 18; i++) {
				vFactorA[0] += Integer.valueOf(sAnswer[i]);
			}

			// 2总体印象分19
			vFactorA[1] = Integer.valueOf(sAnswer[18]);

			ClsScore.Scap scap = new ClsScore.Scap();

			scap.setTotal_o(vFactorA[0]);
			scap.setTotalImpress_o(vFactorA[1]);

			result.setObject(scap);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 四十七、老年抑郁量表（Gds）共30题
	private static ClsAnswerResult GetGdsFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 30;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共2组，第一组0,1，第二组1,0
			String[] strNumberA = { "1,5,7,9,15,19,21,27,29,30",
					"2,3,4,6,8,10,11,12,13,14,16,17,18,20,22,23,24,25,26,28" };
			int[][] intScoreA = { { 0, 1 }, { 1, 0 } };
			String[] strSubA;

			int vFactor = 0; // 实际为1个因子

			// 原始分
			// 总分
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactor += intScoreA[i][Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]) - 1];
				}
			}

			// 按原始分得到“诊断结果”
			// 按原始分得到“指导意见”
			int[] intValueA = { 10, 20 };
			String[] strValueA = { "正常", "轻度抑郁", "中重度抑郁" };
			String vAppraise = strValueA[strValueA.length - 1];
			String vDoctorIdea = "Gds.1.3";

			for (i = 0; i < intValueA.length; i++) {
				if (vFactor <= intValueA[i]) {
					vAppraise = strValueA[i];
					vDoctorIdea = "Gds.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Gds gds = new ClsScore.Gds();

			gds.setTotal_o(vFactor);
			gds.setTotal_a(vAppraise);
			gds.setTotal_d(vDoctorIdea);

			result.setObject(gds);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 四十八、痴呆简易筛查量表（Bssd）共30题
	private static ClsAnswerResult GetBssdFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 30;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i;
			// 共一组1,0

			int vFactor = 0; // 实际为1个因子

			// 总分
			for (i = 0; i < sAnswer.length; i++) {
				vFactor += 2 - Integer.valueOf(sAnswer[i]);
			}

			int intLocal = 2;
			/*
			 * Select Case strEdu Case "文盲" intLocal = 0 Case "小学" intLocal = 1 Case Else
			 * End Select
			 */

			String strEdu = answer.getEducation();
			if (strEdu != null) {
				if (strEdu.equals("文盲")) {
					intLocal = 0;
				} else if (strEdu.equals("小学")) {
					intLocal = 1;
				} else {
					// 定义时已经赋值
				}
			} else {
				// 定义时已经赋值
			}

			// 按总分得到“诊断结果”
			// 按总分得到“指导意见”
			int[][] intValueA = { { 17, 10, 5 }, { 20, 14, 8 }, { 23, 17, 10 } };
			String[] strValueA = { "正常", "有痴呆表现", "有痴呆表现", "有痴呆表现" };
			String vAppraise = strValueA[strValueA.length - 1];
			String vDoctorIdea = "Bssd.1.4";
			for (i = 0; i < intValueA[0].length; i++) {
				if (vFactor >= intValueA[intLocal][i]) {
					vAppraise = strValueA[i];
					vDoctorIdea = "Bssd.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Bssd bssd = new ClsScore.Bssd();

			bssd.setTotal_o(vFactor);
			bssd.setTotal_a(vAppraise);
			bssd.setTotal_d(vDoctorIdea);

			result.setObject(bssd);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 四十九、缺血指数量表（His）共13题 ****
	private static ClsAnswerResult GetHisFactorScore(ClsAnswerRequest answer) {
		// 1Hachinski指数，2Rosen指数
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 13;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j, k;

			// 共二组，第一组1,0，第二组2,0
			String[][] strNumberA = { { "2,4,5,6,7,8,9,11", "1,3,10,12,13" }, { "2,5,7,8,9,11", "1,10,13" } };
			String[] strSubA;
			int[][] intScoreA = { { 1, 0 }, { 2, 0 } };

			int[] vFactorA = new int[2]; // 实际为2个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			// 原始分
			for (i = 0; i < strNumberA.length; i++) {
				for (j = 0; j < strNumberA[0].length; j++) {
					strSubA = strNumberA[i][j].split(",");
					for (k = 0; k < strSubA.length; k++) {
						vFactorA[i] += intScoreA[j][Integer.valueOf(sAnswer[Integer.valueOf(strSubA[k]) - 1]) - 1];
					}
				}
			}

			// 按“Hachinski指数”得到“诊断结果”
			// 按“Hachinski指数”得到“指导意见”
			int[] intValueA = { 3, 6 };
			String[] strValueA = { "属老年性痴呆    (Hachinski指数)", "属混合性痴呆    (Hachinski指数)", "属血管性痴呆    (Hachinski指数)" };
			String vAppraise = strValueA[strValueA.length - 1];
			String vDoctorIdea = "His.1.3";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactorA[0] <= intValueA[i]) {
					vAppraise = strValueA[i];
					vDoctorIdea = "His.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.His his = new ClsScore.His();

			his.setHach_o(vFactorA[0]);
			his.setHach_a(vAppraise);
			his.setHach_d(vDoctorIdea);
			his.setRosen_o(vFactorA[1]);

			result.setObject(his);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 五十、长谷川痴呆量表（Hds）共13题 ****
	private static ClsAnswerResult GetHdsFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 13;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共五组，第一组3,0,0,0,0，第二组2.5,0,0,0,0，第三组2,0,0,0,0，第四组3.5,0,0,0,0，第五组3.5,2.5,1.5,0.5,0
			String[] strNumberA = { "1,8", "2,4,7", "3,5,9,10,11,12", "6", "13" };
			String[] strSubA;
			float[][] sngScoreA = { { 3f, 0f, 0f, 0f, 0f }, { 2.5f, 0f, 0f, 0f, 0f }, { 2f, 0f, 0, 0, 0 },
					{ 3.5f, 0f, 0f, 0f, 0f }, { 3.5f, 2.5f, 1.5f, 0.5f, 0f } };

			float vFactor = 0; // 实际为1个因子

			// 总分
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactor += sngScoreA[i][Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]) - 1];
				}
			}

			// 按总分得到“诊断结果”
			/*
			 * Select Case strEdu Case "文盲" vAppraise = IIf(vFactor < 16, "痴呆", "正常") Case
			 * "小学" vAppraise = IIf(vFactor < 20, "可能有痴呆", "正常") Case Else vAppraise =
			 * IIf(vFactor < 24, "可能有痴呆", "正常") End Select
			 */
			String vAppraise = "";
			String strEdu = answer.getEducation();
			if (strEdu != null) {
				if (strEdu.equals("文盲")) {
					vAppraise = (vFactor < 16 ? "痴呆" : "正常");
				} else if (strEdu.equals("小学")) {
					vAppraise = (vFactor < 20 ? "可能有痴呆" : "正常");
				} else {
					vAppraise = (vFactor < 24 ? "可能有痴呆" : "正常");
				}
			} else {
				vAppraise = (vFactor < 24 ? "可能有痴呆" : "正常");
			}

			ClsScore.Hds hds = new ClsScore.Hds();

			hds.setTotal_o(vFactor);
			hds.setTotal_a(vAppraise);

			result.setObject(hds);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 五十一、简易智力状态检查（Mmse）共30题 ****
	private static ClsAnswerResult GetMmseFactorScore(ClsAnswerRequest answer) {
		// 定向力,记忆力,注意力和计算力,回忆能力,语言能力,总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 30;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;
			// 共一组，1,0,0,0,0
			int[] intNumberA = { 10, 3, 5, 3, 9 };

			int[] vFactorA = new int[6]; // 实际为6个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			int intIndex = 0;
			for (i = 0; i < intNumberA.length; i++) {
				for (j = intIndex; j < intIndex + intNumberA[i]; j++) {
					if (Integer.valueOf(sAnswer[j]) == 1) {
						vFactorA[i] += 1;
						vFactorA[5] += 1;
					}
				}
				intIndex += intNumberA[i];
			}

			int intLocal = 2;
			/*
			 * Select Case strEdu Case "文盲" intLocal = 0 Case "小学" intLocal = 1 End Select
			 */

			String strEdu = answer.getEducation();
			if (strEdu != null) {
				if (strEdu.equals("文盲")) {
					intLocal = 0;
				} else if (strEdu.equals("小学")) {
					intLocal = 1;
				} else {
					// 定义时已经赋值
				}
			} else {
				// 定义时已经赋值
			}

			// 按总分得到“诊断结果”
			// 按总分得到“指导意见”(产品部给的评价与现有评价不同，以现在的评价为准)
			int[][] intValueA = { { 18, 13, 6 }, { 21, 16, 11 }, { 25, 20, 15 } };
			String[] strValueA = { "正常", "有痴呆表现", "有痴呆表现", "有痴呆表现" };
			String vAppraise = strValueA[strValueA.length - 1];
			String vDoctorIdea = "Mmse.1.4";
			for (i = 0; i < intValueA[0].length; i++) {
				if (vFactorA[5] >= intValueA[intLocal][i]) {
					vAppraise = strValueA[i];
					vDoctorIdea = "Mmse.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Mmse mmse = new ClsScore.Mmse();

			mmse.setDxl_o(vFactorA[0]);
			mmse.setJyl_o(vFactorA[1]);
			mmse.setZyl_o(vFactorA[2]);
			mmse.setHyl_o(vFactorA[3]);
			mmse.setYyl_o(vFactorA[4]);
			mmse.setTotal_o(vFactorA[5]);
			mmse.setTotal_a(vAppraise);
			mmse.setTotal_d(vDoctorIdea);

			result.setObject(mmse);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 五十二、五十三、五十四、五十五、儿童行为量表（Cbcl），共146题
	private static ClsAnswerResult GetCbclFactorScore(ClsAnswerRequest answer) {
		// 2007-01-05 Modify,
		// vAppraise::1-m(4-5),2-m(6-11),3-m(12-16),4-f(4-5),5-f(6-11),6-f(12-16)
		// 1总粗分，2活动能力，3社交能力，4学习能力
		// 男（4-5岁）：5社交退缩，6躯体诉述，7抑郁，8幼稚不成熟，9性问题，10分裂样，11攻击，12违纪
		// 男（6-11岁）：5分裂性，6抑郁，7交往不良，8强迫性，9体诉，10社交退缩，11多动，12攻击性，13违纪
		// 男（12-16岁）：5体诉，6分裂样，7交往不良，8不成熟，9强迫性，10敌意性，11违纪，12攻击性，13多动
		// 女（4-5岁）：5抑郁，6躯体诉述，7分裂样，8社会退缩，9性问题，10肥胖，11攻击，12多动
		// 女（6-11岁）：5抑郁，6社交退缩，7体诉，8分裂强迫，9多动，10性问题，11违纪，12攻击性，13残忍
		// 女（12-16岁）：5焦虑强迫，6体诉，7分裂样，8抑郁退缩，9不成熟，10违纪，11攻击性，12残忍
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 146;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 前3个因子计分有所不同
			// 共二组，第一组0,0,1,2；第二组0,1,2,3
			int[][] intScoreA = { { 0, 0, 1, 2, 0 }, { 0, 1, 2, 3, 0 } };
			// 后9个因子计分，共一组，0,1,2,3,4
			String[] strNumberA;
			String[] strSubA;
			// “医生意见”的分隔分
			int[][] intValueA;

			// 为导出数据，加入了年龄类型（数据库为Age_type）
			int vAppraise;

			String[] vDoctorIdeaA = new String[13]; // 按原始分得到“医生意见”
			float[] vFactorA = new float[13]; // 实际为13个因子，2006-05-22增加了“总粗分”

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
				vDoctorIdeaA[i] = "";
			}

			// 前三个因子
			int[] intPreA = new int[26];
			int intLocal = 0;
			for (i = 0; i < intPreA.length; i++) {
				if (i == 16) {
					intLocal += 1;
				}
				intPreA[i] = intScoreA[intLocal][Integer.valueOf(strChildAnswerA[i]) - 1];
			}
			// 活动能力 = 题(1) + 0.5 * 题(2) + 0.5 * 题(3) + 题(4) + 0.5 * 题(5) + 0.5 *
			// 题(6) + 题(9) + 题(10)
			BigDecimal bd1 = new BigDecimal(intPreA[0] + 0.5 * (intPreA[1] + intPreA[2] + intPreA[4] + intPreA[5])
					+ intPreA[3] + intPreA[8] + intPreA[9]);
			vFactorA[1] = bd1.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
			// 社交能力 = 题(7) + 题(8) + 题(11) + 题(12) + 1 / 3 * (题(13) + 题(14) +
			// 题(15)) + 题(16)
			BigDecimal bd2 = new BigDecimal(intPreA[6] + intPreA[7] + intPreA[10] + intPreA[11]
					+ (float) (intPreA[12] + intPreA[13] + intPreA[14]) / (float) 3 + intPreA[15]);
			vFactorA[2] = bd2.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
			// 学习能力 = 1 / 7 * (题(17) + 题(18) + 题(19) + 题(20) + 题(21) + 题(22) +
			// 题(23)) + 题(24) + 题(25) + 题(26)
			BigDecimal bd3 = new BigDecimal((float) (intPreA[16] + intPreA[17] + intPreA[18] + intPreA[19] + intPreA[20]
					+ intPreA[21] + intPreA[22]) / (float) 7 + intPreA[23] + intPreA[24] + intPreA[25]);
			vFactorA[3] = bd3.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();

			// 计分，分成男女，各三个年龄段
			String strTableCode;
			int intSex = answer.getSex();
			float floAge = answer.getAge();
			if (intSex == 1) {
				if (floAge < 6) {
					vAppraise = 1; // 为导出数据，加入了年龄类型（数据库为Age_type）
					strTableCode = "Cbcl1";
					String[] arrNumber = { "39,43,44,68,71,72,98,108,113,120,124,144", "50,82,83,84,87,88",
							"35,38,40,53,55,57,58,59,60,61,73,76,78,102,104,108,116,120,121,122,129,135,136,144,145",
							"27,34,37,39,40,54,62,64,95,97,110,112", "31,57,92,93,106,143",
							"44,66,79,99,100,103,109,118,133",
							"29,36,41,42,45,46,47,48,51,52,53,63,67,69,71,90,99,107,119,120,127,128,130,137,142",
							"60,62,63,64,65,105,114,115,123,124,129,139" };
					int[][] arrValue = { { 3, 7 }, { 3, 5 }, { 5, 14 }, { 5, 11 }, { 1, 2 }, { 2, 5 }, { 10, 20 },
							{ 2, 5 } };
					strNumberA = arrNumber;
					intValueA = arrValue;
				} else if (6 <= floAge && floAge < 12) {
					vAppraise = 2;
					strTableCode = "Cbcl2";
					String[] arrNumber = { "37,55,56,66,73,76,92,103,108",
							"38,40,44,57,58,59,60,61,71,76,78,104,121,122,124,136,145", "39,98,102,104,108,113,119,136",
							"35,39,43,72,73,76,80,99,109,113,116,117,118,125,126,133", "75,77,80,82,83,84,87,88,110",
							"51,60,64,68,74,97,135,144", "27,34,36,39,43,46,67,94,95,97,112",
							"29,33,42,45,48,49,51,53,63,69,74,80,101,107,119,120,121,123,126,127,128,130,137",
							"46,47,49,65,69,100,105,114,115,123,134,139" };
					int[][] arrValue = { { 3, 6 }, { 3, 10 }, { 3, 6 }, { 3, 9 }, { 2, 7 }, { 3, 6 }, { 5, 11 },
							{ 7, 20 }, { 3, 8 } };
					strNumberA = arrNumber;
					intValueA = arrValue;
				} else // 理论上最大是16岁，这里就不控制了
				{
					vAppraise = 3;
					strTableCode = "Cbcl3";
					String[] arrNumber = { "62,75,76,77,80,82,83,84,85,86,87,88,113,135,145",
							"31,37,56,57,58,66,77,78,132,135",
							"39,68,98,102,104,108,113,119,120,121,122,135,136,144,145", "27,37,40,45,97,141,142",
							"33,35,43,57,96,99,117,118,137", "27,38,46,47,51,59,60,61,63,64,74,95,97,144",
							"46,47,49,65,69,94,100,105,114,115,134,138,139",
							"29,36,42,45,48,53,60,63,67,71,90,101,119,120,121,122,123,126,127,128,130,137",
							"27,34,36,49,67,70,71,94,95,107" };
					int[][] arrValue = { { 4, 11 }, { 4, 8 }, { 5, 15 }, { 3, 6 }, { 3, 6 }, { 4, 11 }, { 3, 9 },
							{ 7, 19 }, { 5, 10 } };
					strNumberA = arrNumber;
					intValueA = arrValue;
				}
			} else // 女
			{
				if (floAge < 6) {
					vAppraise = 4;
					strTableCode = "Cbcl4";
					String[] arrNumber = { "56,57,58,59,60,61,74,76,78,104,108,120,121,136,144,145",
							"32,37,40,45,62,77,80,82,83,84,87,88,101,140",
							"36,37,40,45,55,60,66,71,73,76,103,109,117,118,122,125,133,142",
							"27,34,39,43,53,72,82,94,98,99,102,112,113,122,135,144", "31,65,92,93,106,116,129,143",
							"31,64,73,74,79,81,99,115,117,118,125,127",
							"29,36,41,42,45,46,47,48,49,51,52,63,67,69,74,90,101,119,120,123,126,127,128,130,137",
							"34,36,49,62,102,67,82,94,107,126,137" };
					int[][] arrValue = { { 3, 10 }, { 6, 11 }, { 4, 9 }, { 3, 8 }, { 2, 3 }, { 2, 4 }, { 6, 15 },
							{ 3, 6 } };
					strNumberA = arrNumber;
					intValueA = arrValue;
				} else if (6 <= floAge && floAge < 12) {
					vAppraise = 5;
					strTableCode = "Cbcl5";
					String[] arrNumber = { "37,38,56,57,58,59,60,61,64,71,76,78,104,108,121,136,144,145",
							"39,68,98,102,108,113,120,121,135,136,144", "28,73,77,80,82,83,84,85,86,87,88,110,125",
							"35,44,66,99,100,103,109,117,118,124,133", "27,34,36,39,43,49,64,67,74,94,95,97,112,113",
							"78,93,96,106,126,129", "65,69,100,114,115,123",
							"29,33,40,42,45,47,48,49,51,53,59,63,67,74,101,107,119,126,127,128,130,137,142",
							"31,41,42,46,47,63,90" };
					int[][] arrValue = { { 5, 14 }, { 4, 9 }, { 3, 9 }, { 2, 4 }, { 4, 11 }, { 3, 4 }, { 2, 3 },
							{ 7, 19 }, { 2, 4 } };
					strNumberA = arrNumber;
					intValueA = arrValue;
				} else // 理论上最大是16岁，这里就不控制了
				{
					vAppraise = 6;
					strTableCode = "Cbcl6";
					String[] arrNumber = { "35,38,40,43,55,56,57,58,59,60,61,71,73,76,78,104,109,133,145",
							"56,77,82,83,84,85,87,88", "43,55,66,73,103,113,117,118,129",
							"68,80,98,102,104,108,110,113,119,121,135,136,144",
							"27,34,36,37,39,43,51,64,74,91,95,97,113,116,131",
							"34,48,49,52,65,67,69,94,96,100,102,114,115,123,134,138",
							"29,33,42,45,48,53,59,60,63,90,101,107,119,120,121,122,123,126,127,128,130,137",
							"41,46,47,51,60,63,74,90,114,130,139" };
					int[][] arrValue = { { 10, 18 }, { 3, 8 }, { 2, 4 }, { 5, 13 }, { 5, 12 }, { 5, 12 }, { 6, 18 },
							{ 2, 5 } };
					strNumberA = arrNumber;
					intValueA = arrValue;
				}
			}

			// 后9个因子
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactorA[i + 4] += Integer.valueOf(strChildAnswerA[Integer.valueOf(strSubA[j]) - 1]) - 1;
				}
			}

			// 2007-02-01 总粗分：第27到第146题所选答案的总分，0,1,2,3,4计;
			for (i = 26; i < 146; i++) {
				vFactorA[0] += Integer.valueOf(strChildAnswerA[i]) - 1;
			}

			// 按“原始分”得到“医生意见”
			// （在成人版中无医生意见）
			for (i = 0; i < intValueA.length; i++) {
				vDoctorIdeaA[i + 4] = strTableCode + "." + String.valueOf(i + 1) + ".3";
				for (j = 0; j < intValueA[0].length; j++) {
					if (vFactorA[i + 4] < intValueA[i][j]) {
						vDoctorIdeaA[i + 4] = strTableCode + "." + String.valueOf(i + 1) + "." + String.valueOf(j + 1);
						break;
					}
				}
			}

			ClsScore.Cbcl cbcl = new ClsScore.Cbcl();

			cbcl.setTotal_o(vFactorA[0]);
			cbcl.setHdnl_o(vFactorA[1]);
			cbcl.setSjnl_o(vFactorA[2]);
			cbcl.setXxnl_o(vFactorA[3]);

			cbcl.setFactor1_o(vFactorA[4]);
			cbcl.setFactor1_d(vDoctorIdeaA[4]);

			cbcl.setFactor2_o(vFactorA[5]);
			cbcl.setFactor2_d(vDoctorIdeaA[5]);

			cbcl.setFactor3_o(vFactorA[6]);
			cbcl.setFactor3_d(vDoctorIdeaA[6]);

			cbcl.setFactor4_o(vFactorA[7]);
			cbcl.setFactor4_d(vDoctorIdeaA[7]);

			cbcl.setFactor5_o(vFactorA[8]);
			cbcl.setFactor5_d(vDoctorIdeaA[8]);

			cbcl.setFactor6_o(vFactorA[9]);
			cbcl.setFactor6_d(vDoctorIdeaA[9]);

			cbcl.setFactor7_o(vFactorA[10]);
			cbcl.setFactor7_d(vDoctorIdeaA[10]);

			cbcl.setFactor8_o(vFactorA[11]);
			cbcl.setFactor8_d(vDoctorIdeaA[11]);

			cbcl.setFactor9_o(vFactorA[12]);
			cbcl.setFactor9_d(vDoctorIdeaA[12]);

			cbcl.setAge_type(vAppraise);

			result.setObject(cbcl);

			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 五十六、Conners父母量表（Conn）共48题 ****
	private static ClsAnswerResult GetConnFactorScore(ClsAnswerRequest answer) {
		// 1品行问题，2学习问题，3心身障碍，4冲动——多动，5焦虑，6多动指数
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 48;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共一组，1,2,3,4
			String[] strNumberA = { "2,8,14,19,20,21,22,23,27,33,34,39", "10,25,31,37", "32,41,43,44,48", "4,5,11,13",
					"12,16,24,47", "4,7,11,13,14,25,31,33,37,38" };
			String[] strSubA;

			String[] vDoctorIdeaA = new String[6];
			for (i = 0; i < vDoctorIdeaA.length; i++) {
				vDoctorIdeaA[i] = "";
			}

			// 报告中只出平均分
			float[] vFactorA = new float[6]; // 实际为6个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			float[][] sngFactorA = new float[6][2]; // 原始分，标准分
			for (i = 0; i < sngFactorA.length; i++) {
				for (j = 0; j < sngFactorA[0].length; j++) {
					sngFactorA[i][j] = 0;
				}
			}

			// 原始分
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					sngFactorA[i][0] += Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]);
				}
			}
			// 标准分，公式：50 + 10 * (((Original(i)–arrNum(i)) /
			// arrNum(i))–arrMinus(i)) / arrDivisor(i)
			int[] intNumA = { 12, 4, 5, 4, 4, 10 };
			float[][] sngStandardA;
			int intSex = answer.getSex();
			float floAge = answer.getAge();

			if (intSex == 1) {
				if (floAge < 6) {
					float[][] arrStandard = { { 0.53f, 0.5f, 0.07f, 1.01f, 0.61f, 0.72f },
							{ 0.39f, 0.33f, 0.15f, 0.65f, 0.61f, 0.4f } };
					sngStandardA = arrStandard;
				} else if (6 <= floAge && floAge < 9) {
					float[][] arrStandard = { { 0.5f, 0.64f, 0.13f, 0.93f, 0.51f, 0.69f },
							{ 0.4f, 0.45f, 0.23f, 0.6f, 0.51f, 0.46f } };
					sngStandardA = arrStandard;
				} else if (9 <= floAge && floAge < 12) {
					float[][] arrStandard = { { 0.53f, 0.54f, 0.18f, 0.92f, 0.42f, 0.66f },
							{ 0.38f, 0.52f, 0.26f, 0.6f, 0.47f, 0.44f } };
					sngStandardA = arrStandard;
				} else if (12 <= floAge && floAge < 15) {
					float[][] arrStandard = { { 0.49f, 0.66f, 0.22f, 0.82f, 0.58f, 0.62f },
							{ 0.41f, 0.57f, 0.44f, 0.54f, 0.59f, 0.45f } };
					sngStandardA = arrStandard;
				} else // 理论上最大17岁，这里模糊处理下
				{
					float[][] arrStandard = { { 0.47f, 0.62f, 0.13f, 0.7f, 0.59f, 0.51f },
							{ 0.44f, 0.55f, 0.26f, 0.51f, 0.58f, 0.41f } };
					sngStandardA = arrStandard;
				}
			} else {
				if (floAge < 6) {
					float[][] arrStandard = { { 0.49f, 0.62f, 0.1f, 1.15f, 0.51f, 0.78f },
							{ 0.35f, 0.57f, 0.17f, 0.77f, 0.59f, 0.56f } };
					sngStandardA = arrStandard;
				} else if (6 <= floAge && floAge < 9) {
					float[][] arrStandard = { { 0.41f, 0.45f, 0.19f, 0.95f, 0.57f, 0.59f },
							{ 0.28f, 0.38f, 0.27f, 0.59f, 0.66f, 0.35f } };
					sngStandardA = arrStandard;
				} else if (9 <= floAge && floAge < 12) {
					float[][] arrStandard = { { 0.4f, 0.43f, 0.17f, 0.8f, 0.49f, 0.52f },
							{ 0.36f, 0.38f, 0.28f, 0.59f, 0.57f, 0.34f } };
					sngStandardA = arrStandard;
				} else if (12 <= floAge && floAge < 15) {
					float[][] arrStandard = { { 0.39f, 0.44f, 0.23f, 0.72f, 0.54f, 0.49f },
							{ 0.4f, 0.45f, 0.28f, 0.55f, 0.53f, 0.34f } };
					sngStandardA = arrStandard;
				} else // 理论上最大17岁，这里模糊处理下
				{
					float[][] arrStandard = { { 0.37f, 0.35f, 0.19f, 0.6f, 0.51f, 0.42f },
							{ 0.33f, 0.38f, 0.25f, 0.55f, 0.53f, 0.34f } };
					sngStandardA = arrStandard;
				}
			}
			// 标准分得分
			for (i = 0; i < sngFactorA.length; i++) {
				sngFactorA[i][1] = 50 + 10 * (((sngFactorA[i][0] - intNumA[i]) / intNumA[i]) - sngStandardA[0][i])
						/ sngStandardA[1][i];
			}
			// 平均分
			for (i = 0; i < vFactorA.length; i++) {
				BigDecimal bd = new BigDecimal((sngFactorA[i][0] - intNumA[i]) / intNumA[i]);
				vFactorA[i] = bd.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
				// 按“平均分”得到“指导意见”
				if (vFactorA[i] > sngStandardA[0][i] + sngStandardA[1][i]) {
					vDoctorIdeaA[i] = "Conn." + String.valueOf(i + 1) + ".1";
				} else if (vFactorA[i] < sngStandardA[0][i] - sngStandardA[1][i]) {
					vDoctorIdeaA[i] = "Conn." + String.valueOf(i + 1) + ".2";
				}
			}

			ClsScore.Conn conn = new ClsScore.Conn();

			conn.setPxwt_ave(vFactorA[0]);
			conn.setPxwt_d(vDoctorIdeaA[0]);

			conn.setXxwt_ave(vFactorA[1]);
			conn.setXxwt_d(vDoctorIdeaA[1]);

			conn.setXsza_ave(vFactorA[2]);
			conn.setXsza_d(vDoctorIdeaA[2]);

			conn.setCddd_ave(vFactorA[3]);
			conn.setCddd_d(vDoctorIdeaA[3]);

			conn.setJl_ave(vFactorA[4]);
			conn.setJl_d(vDoctorIdeaA[4]);

			conn.setDdzs_ave(vFactorA[5]);
			conn.setDdzs_d(vDoctorIdeaA[5]);

			result.setObject(conn);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 五十七、个人评价问卷（Pei）共54题
	private static ClsAnswerResult GetPeiFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 54;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共二组，第一组1,2,3,4，第二组4,3,2,1
			int[][] intNumberA = {
					{ 2, 3, 7, 8, 9, 13, 15, 16, 18, 21, 22, 23, 25, 28, 29, 30, 32, 34, 35, 38, 40, 44, 45, 49, 52, 53,
							54 },
					{ 1, 4, 5, 6, 10, 11, 12, 14, 17, 19, 20, 24, 26, 27, 31, 33, 36, 37, 39, 41, 42, 43, 46, 47, 48,
							50, 51 } };
			int[][] intScoreA = { { 1, 2, 3, 4 }, { 4, 3, 2, 1 } };

			int vFactor = 0; // 实际为1个因子

			// 总分
			for (i = 0; i < intNumberA.length; i++) {
				for (j = 0; j < intNumberA[0].length; j++) {
					vFactor += intScoreA[i][Integer.valueOf(sAnswer[intNumberA[i][j] - 1]) - 1];
				}
			}

			// 按总分得到“诊断结果”
			// 按总分得到“指导意见”
			int[] intValueA = { 108, 136, 161, 190 };
			String[] strValueA = { "无自信", "有些自信", "比较自信", "自信", "非常自信" };
			String vAppraise = strValueA[strValueA.length - 1];
			String vDoctorIdea = "Pei.1.5";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactor <= intValueA[i]) {
					vAppraise = strValueA[i];
					vDoctorIdea = "Pei.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Pei pei = new ClsScore.Pei();

			pei.setTotal_o(vFactor);
			pei.setTotal_a(vAppraise);
			pei.setTotal_d(vDoctorIdea);

			result.setObject(pei);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 五十八、A型行为（A）共60题
	private static ClsAnswerResult GetAFactorScore(ClsAnswerRequest answer) {
		// 1时间匆忙感特征，2争强好胜,怀有戒心或敌意特征，3谎分，4总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 60;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j, k;

			// 共二组分，第一组0,1，第二组1,0
			// 总分(由前2个因子分相加)
			String[][] strNumberA = { { "1,14,19,30,54", "18,36,45,49,51", "13,33,37,48,56" },
					{ "2,3,6,7,10,11,21,22,26,27,32,34,40,42,44,46,50,53,55,58",
							"4,5,9,12,15,16,17,23,25,28,29,31,35,38,39,41,47,57,59,60", "8,20,24,43,52" } };
			String[] strSubA;
			int[][] intScoreA = { { 0, 1 }, { 1, 0 } };

			// “诊断结果”
			String[] vAppraiseA = new String[4];
			// “指导意见”
			String[] vDoctorIdeaA = new String[4];
			for (i = 0; i < vAppraiseA.length; i++) {
				vAppraiseA[i] = "";
			}

			for (i = 0; i < vDoctorIdeaA.length; i++) {
				vDoctorIdeaA[i] = "";
			}

			int[] vFactorA = new int[4]; // 实际为4个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			// 原始分
			// 前3个因子
			for (i = 0; i < strNumberA.length; i++) {
				for (j = 0; j < strNumberA[0].length; j++) {
					strSubA = strNumberA[i][j].split(",");
					for (k = 0; k < strSubA.length; k++) {
						vFactorA[j] += intScoreA[i][Integer.valueOf(sAnswer[Integer.valueOf(strSubA[k]) - 1]) - 1];
					}
				}
			}
			// 总分(由前2个因子相加)
			vFactorA[3] = vFactorA[0] + vFactorA[1];
			// “诊断结果”和“指导意见”
			// “时间匆忙感特征”，“争强好胜,怀有戒心或敌意特征”，“总分”
			int[][] intValueA = { { 20, 15, 10, 5 }, { 20, 15, 10, 5 }, { 37, 29, 27, 19 } };
			String[][] strValueA = { { "强", "较强", "中等", "较弱", "弱" }, { "强", "较强", "中等", "较弱", "弱" },
					{ "A 型行为", "A-型行为", "M 型行为", "B-型行为", "B 型行为" } };
			int intLocal = 0;
			for (i = 0; i < intValueA.length; i++) {
				intLocal = (i <= 1 ? i : i + 1);
				// “诊断结果”
				vAppraiseA[intLocal] = strValueA[i][strValueA[0].length - 1];
				// “指导意见”
				vDoctorIdeaA[intLocal] = "A." + String.valueOf(intLocal + 1) + ".5";
				for (j = 0; j < intValueA[0].length; j++) {
					if (vFactorA[intLocal] >= intValueA[i][j]) {
						vAppraiseA[intLocal] = strValueA[i][j];
						vDoctorIdeaA[intLocal] = "A." + String.valueOf(intLocal + 1) + "." + String.valueOf(j + 1);
						break;
					}
				}
			}

			// “谎分”
			vAppraiseA[2] = (vFactorA[2] > 6 ? "测验时有掩饰或不认真的现象" : "测验合作");
			vDoctorIdeaA[2] = (vFactorA[2] > 6 ? "A.3.1" : "");

			ClsScore.A a = new ClsScore.A();

			a.setSjcm_o(vFactorA[0]);
			a.setSjcm_a(vAppraiseA[0]);
			a.setSjcm_d(vDoctorIdeaA[0]);

			a.setZqhs_o(vFactorA[1]);
			a.setZqhs_a(vAppraiseA[1]);
			a.setZqhs_d(vDoctorIdeaA[1]);

			a.setLie_o(vFactorA[2]);
			a.setLie_a(vAppraiseA[2]);
			a.setLie_d(vDoctorIdeaA[2]);

			a.setTotal_o(vFactorA[3]);
			a.setTotal_a(vAppraiseA[3]);
			a.setTotal_d(vDoctorIdeaA[3]);

			result.setObject(a);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 五十九、疲劳量表（Fs14）共14题
	private static ClsAnswerResult GetFs14FactorScore(ClsAnswerRequest answer) {
		// 1躯体疲劳分值，2脑力疲劳分值，3总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 14;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// “躯体疲劳分值”1-8，1,0
			// “脑力疲劳分值”有两组计分
			int[][] intNumberA = { { 10, 13, 14 }, { 9, 11, 12 } };
			int[][] intScoreA = { { 0, 1 }, { 1, 0 } };

			int[] vFactorA = new int[3]; // 实际为3个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			// 第1个因子，“躯体疲劳分值”
			for (i = 0; i < 8; i++) {
				vFactorA[0] += 2 - Integer.valueOf(sAnswer[i]);
			}

			// 第2个因子，“脑力疲劳分值”
			for (i = 0; i < intNumberA.length; i++) {
				for (j = 0; j < intNumberA[0].length; j++) {
					vFactorA[1] += intScoreA[i][Integer.valueOf(sAnswer[intNumberA[i][j] - 1]) - 1];
				}
			}
			// 总分
			vFactorA[2] = vFactorA[0] + vFactorA[1];

			ClsScore.Fs14 fs14 = new ClsScore.Fs14();

			fs14.setQtpl_o(vFactorA[0]);
			fs14.setNlpl_o(vFactorA[1]);
			fs14.setTotal_o(vFactorA[2]);

			result.setObject(fs14);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 六十、匹茨堡睡眠质量指数（Psqi）共24(21)题
	private static ClsAnswerResult GetPsqiFactorScore(ClsAnswerRequest answer) {
		// 1主观睡眠质量总分，2睡眠潜伏期总分，3睡眠持续性总分，4习惯性睡眠效率总分，5睡眠紊乱总分，6使用睡眠药物总分，7白天功能紊乱总分，8影响睡眠的其他原因，9睡眠质量指数总评
		// 由于其中4题是输入，实际的题目数是20，四题分别是1上床时间，3起床时间，4实际睡眠，14题
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 24;

			int intI;
			// 转换回原来格式
			String[] strTemp1 = answer.getAnswer().split(g_nChar);
			String strAnswer1 = strTemp1[0].replaceAll("@", "");
			String strAnswer3 = strTemp1[2].replaceAll("@", "");
			String strAnswer4 = strTemp1[3].replaceAll("@", "");
			String[] strAnswer14 = { "", "" };
			String[] strTemp14 = strTemp1[13].split("&@");

			String strTemp = "";

			for (intI = 0; intI < strTemp14.length; intI++) {
				strAnswer14[intI] = strTemp14[intI].trim();
			}

			for (intI = 0; intI < strTemp1.length; intI++) {
				switch (intI) {
				case 0:
				case 2:
				case 3:
					strTemp += "0|";
					break;
				case 13:
					strTemp += strAnswer14[0] + "|";
					break;
				default:
					strTemp += strTemp1[intI] + "|";
					break;
				}
			}

			strTemp = strTemp.substring(0, strTemp.length() - 1) + "@@" + strAnswer1 + "@@" + strAnswer3 + "@@"
					+ strAnswer4 + "@@" + strAnswer14[1];

			// 临时赋值，JAVA默认切割时为空就不增加数组长度
			String[] strAnswer_c_Temp = strTemp.split(g_sChar);
			String[] strAnswer_c = { "", "", "", "", "" };
			for (intI = 0; intI < strAnswer_c_Temp.length; intI++) {
				strAnswer_c[intI] = strAnswer_c_Temp[intI].trim();
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共一组0,1,2,3
			// 报告显示标准分，无标准分的显示原始分

			// 按标准分得到“诊断结果”
			String[] vAppraiseA = new String[9];

			float[][] vFactorA = new float[9][2]; // 实际为9个因子
			for (i = 0; i < vFactorA.length; i++) {
				for (j = 0; j < vFactorA[0].length; j++) {
					vFactorA[i][j] = 0;
				}
			}

			// 由于“答案”中可能有特殊的内容，要进行分割
			// 正确的应该分出五份内容，第一份是答案，其他四份分别是第1题、第3题、第4题、第14题

			// 原始分和标准分
			// 1主观睡眠质量总分，第15题
			vFactorA[0][0] = Integer.valueOf(sAnswer[14]) - 1;
			vFactorA[0][1] = vFactorA[0][0];

			// 2睡眠潜伏期总分，第2，5题
			int[] intNumOneA = { 2, 5 };
			for (i = 0; i < intNumOneA.length; i++) {
				vFactorA[1][0] += Integer.valueOf(sAnswer[intNumOneA[i] - 1]) - 1;
			}

			// 标准分：0得0分，1~2得1分，3~4得2分，5~6得3分
			BigDecimal bd = new BigDecimal(vFactorA[1][0] / 1.8);
			vFactorA[1][1] = bd.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
			// 第一题，第三题，第四题(全部转换成小时)
			float[] sngTimeA = new float[3];
			String[] strSubA;

			for (i = 1; i < 4; i++) {
				strSubA = strAnswer_c[i].split(":");
				if (strSubA.length - 1 > 0) {
					BigDecimal bd1 = new BigDecimal(
							(Integer.valueOf(strSubA[0]) * 60 + Integer.valueOf(strSubA[1])) / 60);
					sngTimeA[i - 1] = bd1.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
				} else {
					sngTimeA[i - 1] = Float.valueOf(strSubA[0]);
				}
			}

			// 3睡眠持续性总分
			if (sngTimeA[2] >= 7) {
				vFactorA[2][0] = 0;
			} else if (sngTimeA[2] >= 6) {
				vFactorA[2][0] = 1;
			} else if (sngTimeA[2] >= 5) {
				vFactorA[2][0] = 2;
			} else {
				vFactorA[2][0] = 3;
			}
			vFactorA[2][1] = vFactorA[2][0];

			// 4习惯性睡眠效率总分
			BigDecimal bd2 = new BigDecimal(sngTimeA[2] / (24 - sngTimeA[0] + sngTimeA[1]));
			float sngBase = bd2.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
			float[] sngBaseA = { 0.85f, 0.75f, 0.65f };
			vFactorA[3][0] = 3;
			for (i = 0; i < sngBaseA.length; i++) {
				if (sngBase >= sngBaseA[i]) {
					vFactorA[3][0] = i;
					break;
				}
			}
			vFactorA[3][1] = vFactorA[3][0];

			// 5睡眠紊乱总分，第6--14题
			for (i = 6; i < 15; i++) {
				vFactorA[4][0] += Integer.valueOf(sAnswer[i - 1]) - 1;
			}
			// 标准分：0得0分，1~9得1分，10~18得2分，19~27得3分
			i = (int) (vFactorA[4][0]) % 9;
			j = (int) vFactorA[4][0] / 9;
			vFactorA[4][1] = (i > 0 ? j + 1 : j);

			// 6使用睡眠药物总分，第16题
			vFactorA[5][0] = Integer.valueOf(sAnswer[15]) - 1;
			vFactorA[5][1] = vFactorA[5][0];

			// 7白天功能紊乱总分，第17，18题
			for (i = 17; i < 19; i++) {
				vFactorA[6][0] += Integer.valueOf(sAnswer[i - 1]) - 1;
			}
			// 标准分：0得0分，1~2得1分，3~4得2分，5~6得3分
			BigDecimal bd3 = new BigDecimal(vFactorA[6][0] / 1.8);
			vFactorA[6][1] = bd3.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();

			// 8影响睡眠的其他原因（不计分）
			// 9睡眠质量指数总评
			for (i = 0; i < vFactorA.length - 1; i++) {
				vFactorA[i][0] = 0;
				vFactorA[8][1] += vFactorA[i][1];
			}

			BigDecimal bd4 = new BigDecimal(vFactorA[8][1]);
			vFactorA[8][1] = bd4.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();

			// 按标准分得到“诊断结果”
			int[][] intValueA = { { 0, 1, 2 }, { 0, 1, 2 }, { 0, 1, 2 }, { 0, 1, 2 }, { 0, 1, 2 }, { 0, 1, 2 },
					{ 0, 1, 2 }, { 0, 0, 0 }, { 0, 7, 14 } };
			String[] strPrefixA = { "主观睡眠质量", "睡眠潜伏期", "睡眠持续性", "习惯性睡眠效率", "睡眠紊乱", "使用睡眠药物", "白天功能紊乱", "", "睡眠质量" };
			String[][] strSuffixA = { { "非常好", "比较好", "不好", "非常差" }, { "短", "比较短", "比较长", "非常长" },
					{ "长", "比较长", "比较短", "非常短" }, { "非常高", "比较高", "比较低", "非常低" }, { "没有", "比较少", "比较多", "非常多" },
					{ "没有", "比较少", "比较多", "非常多" }, { "没有", "比较少", "比较多", "非常多" }, { "", "", "", "" },
					{ "没有困难", "少数方面有困难", "较多方面有困难", "几乎所有方面都非常困难" } };

			for (i = 0; i < intValueA.length; i++) {
				if (i != 7) {
					vAppraiseA[i] = strPrefixA[i] + strSuffixA[i][3];
					for (j = 0; j < intValueA[0].length; j++) {
						if (vFactorA[i][1] <= intValueA[i][j]) {
							if (i >= 4 && i <= 6) {
								vAppraiseA[i] = strSuffixA[i][j] + strPrefixA[i];
							} else {
								vAppraiseA[i] = strPrefixA[i] + strSuffixA[i][j];
							}
							break;
						}
					}
				}
			}

			// 8影响睡眠的其他原因(14题内容，如果是空的话，显示“没有”)
			vAppraiseA[7] = "没有";
			if (strAnswer_c[4].length() > 0) {
				vAppraiseA[7] = strAnswer_c[4];
			}

			ClsScore.Psqi psqi = new ClsScore.Psqi();

			psqi.setZgsmzl_s(vFactorA[0][1]);
			psqi.setZgsmzl_a(vAppraiseA[0]);

			psqi.setSmqfq_s(vFactorA[1][1]);
			psqi.setSmqfq_a(vAppraiseA[1]);

			psqi.setSmcxx_s(vFactorA[2][1]);
			psqi.setSmcxx_a(vAppraiseA[2]);

			psqi.setXgxsm_s(vFactorA[3][1]);
			psqi.setXgxsm_a(vAppraiseA[3]);

			psqi.setSmwl_s(vFactorA[4][1]);
			psqi.setSmwl_a(vAppraiseA[4]);

			psqi.setSysmyw_s(vFactorA[5][1]);
			psqi.setSysmyw_a(vAppraiseA[5]);

			psqi.setBtgnwl_s(vFactorA[6][1]);
			psqi.setBtgnwl_a(vAppraiseA[6]);

			psqi.setYxsm_a(vAppraiseA[7]);

			psqi.setSmzlzs_s(vFactorA[8][1]);
			psqi.setSmzlzs_a(vAppraiseA[8]);

			result.setObject(psqi);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 六十一、UCLA孤独量表（Ucla）共20题
	private static ClsAnswerResult GetUclaFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 20;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共2组，第一组1,2,3,4，第二组4,3,2,1
			String[] strNumberA = { "2,3,4,7,8,11,12,13,14,17,18", "1,5,6,9,10,15,16,19,20" };
			String[] strSubA;
			int[][] intScoreA = { { 1, 2, 3, 4 }, { 4, 3, 2, 1 } };

			float[][] vFactorA = new float[1][2]; // 实际为1个因子
			for (i = 0; i < vFactorA.length; i++) {
				for (j = 0; j < vFactorA[0].length; j++) {
					vFactorA[i][j] = 0;
				}
			}

			// 原始分
			// 总分
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactorA[0][0] += intScoreA[i][Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]) - 1];
				}
			}
			// 标准分，公式：Standard = 50 + (Original – arrNum(i，1)) * 10 /
			// arrNum(i，2)
			float[][] sngValueA = { { 36.1f, 10.1f }, { 37.1f, 10.9f } };
			int strSex = answer.getSex();
			int intLocal = strSex;
			BigDecimal bd = new BigDecimal(
					50 + (vFactorA[0][0] - sngValueA[intLocal][0]) * 10 / sngValueA[intLocal][1]);
			vFactorA[0][1] = bd.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();

			// 按标准分得到“指导意见”
			int[] intValueA = { 46, 57, 68 };
			String vDoctorIdea = "Ucla.1.4";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactorA[0][1] <= intValueA[i]) {
					vDoctorIdea = "Ucla.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Ucla ucla = new ClsScore.Ucla();

			ucla.setTotal_o(vFactorA[0][0]);
			ucla.setTotal_s(vFactorA[0][1]);
			ucla.setTotal_d(vDoctorIdea);

			result.setObject(ucla);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 六十三、阿森斯失眠量表（Asssm）共8题
	private static ClsAnswerResult GetAsssmFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 8;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i;
			// 共一组，0,1,2,3

			int vFactor = 0; // 实际为1个因子

			// 总分
			for (i = 0; i < sAnswer.length; i++) {
				vFactor += Integer.valueOf(sAnswer[i]) - 1;
			}

			// 按总分得到“诊断结果”
			// 按总分得到“指导意见”
			int[] intValueA = { 4, 7 };
			String[] strValueA = { "无睡眠障碍", "可疑失眠", "失眠" };
			String vAppraise = strValueA[strValueA.length - 1];
			String vDoctorIdea = "Asssm.1.3";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactor < intValueA[i]) {
					vAppraise = strValueA[i];
					vDoctorIdea = "Asssm.1." + String.valueOf(i + 1);
					break;
				}

			}

			ClsScore.Asssm asssm = new ClsScore.Asssm();

			asssm.setTotal_o(vFactor);
			asssm.setTotal_a(vAppraise);
			asssm.setTotal_d(vDoctorIdea);

			result.setObject(asssm);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 六十四、防御方式问卷（Dsq）共88题
	private static ClsAnswerResult GetDsqFactorScore(ClsAnswerRequest answer) {
		// 1不成熟防御机制(8个副因子：投身，被动攻击，潜意显现，抱怨，幻想，分裂，退缩，躯体化)
		// 2成熟机制(3个副因子：升华，压抑，幽默)
		// 3中间型防御机制(13个副因子：反作用形成，解除，制止，回避，理想化，假性利他，伴无能之全能，隔离，同一化，否认，交往倾向，消耗倾向，期望)
		// 4掩饰机制(1个副因子：掩饰因子)
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 88;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共一组1,2,3,4,5,6,7,8,9
			String[] strNumberA = { "4,12,25,36,55,60,66,72,87", "2,22,39,45,54", "7,21,27,33,46", "69,75,82", "40",
					"43,53,64", "9,67", "28,62", "5,74,84", "3,59", "8,61,34", "13,47,56,63,65", "71,78,88",
					"10,17,29,41,50", "32,35,49", "51,58", "1", "11,18,23,24,30,37", "70,76,77,83", "19", "16,42,52",
					"80,86", "73,79,85", "68,81", "6,14,15,20,26,31,38,44,48,57" };
			String[] strSubFactorName = { "投身", "被动攻击", "潜意显现", "抱怨", "幻想", "分裂", "退缩", "躯体化", "升华", "压抑", "幽默",
					"反作用形成", "解除", "制止", "回避", "理想化", "假性利他", "伴无能之全能", "隔离", "同一化", "否认", "交往倾向", "消耗倾向", "期望",
					"掩饰因子" };
			float[][] sngSubFactorA = new float[25][2]; // 副因子
			int[] intGroupA = { 8, 3, 13, 1 }; // 因子分组情况
			int intCount = 0; // 计数器
			int intLocal = 0;
			String[] strSubA;

			// 按副因子的平均分得到“最突出防御机制”
			String vAppraise = "";
			// 按大因子的平均分得到“指导意见”
			String[] vDoctorIdeaA = new String[4];

			float[][] vFactorA = new float[4][2]; // 实际为4个因子
			for (i = 0; i < vFactorA.length; i++) {
				for (j = 0; j < vFactorA[0].length; j++) {
					vFactorA[i][j] = 0;
				}
			}
			for (i = 0; i < strNumberA.length; i++) {
				// 因子的分组情况
				if (intCount >= intGroupA[intLocal]) {
					intLocal += 1;
					intCount = 0;
				}
				// 拆分一般项目
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					// 副因子的原始分
					sngSubFactorA[i][0] += Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]);
				}
				// 大因子的原始分
				vFactorA[intLocal][0] += sngSubFactorA[i][0];
				intCount += 1;
				// 副因子的平均分
				BigDecimal bd = new BigDecimal(sngSubFactorA[i][0] / (strSubA.length));
				sngSubFactorA[i][1] = bd.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
				if (sngSubFactorA[i][1] > 7) {
					// “最突出防御机制”
					vAppraise += strSubFactorName[i] + "，";
				}
			}

			if (vAppraise.length() > 0) {
				vAppraise = vAppraise.substring(0, vAppraise.length() - 1);
			}
			// 大因子的平均分
			int[] intNumA = { 30, 8, 40, 10 };
			for (i = 0; i < intNumA.length; i++) {
				BigDecimal bd1 = new BigDecimal(vFactorA[i][0] / intNumA[i]);
				vFactorA[i][1] = bd1.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();

			}

			// 按大因子的平均分得到“指导意见”
			int[][] intValueA = { { 4, 6, 7 }, { 4, 6, 7 }, { 4, 6, 7 }, { 2, 3, 5 } };
			for (i = 0; i < intValueA.length; i++) {
				vDoctorIdeaA[i] = "Dsq." + String.valueOf(i + 1) + ".4";
				for (j = 0; j < intValueA[0].length; j++) {
					if (vFactorA[i][1] <= intValueA[i][j]) {
						vDoctorIdeaA[i] = "Dsq." + String.valueOf(i + 1) + "." + String.valueOf(j + 1);
						break;
					}
				}
			}

			ClsScore.Dsq dsq = new ClsScore.Dsq();

			dsq.setBcsfy_o(vFactorA[0][0]);
			dsq.setBcsfy_ave(vFactorA[0][1]);
			dsq.setBcsfy_d(vDoctorIdeaA[0]);

			dsq.setCsjz_o(vFactorA[1][0]);
			dsq.setCsjz_ave(vFactorA[1][1]);
			dsq.setCsjz_d(vDoctorIdeaA[1]);

			dsq.setZjxfy_o(vFactorA[2][0]);
			dsq.setZjxfy_ave(vFactorA[2][1]);
			dsq.setZjxfy_d(vDoctorIdeaA[2]);

			dsq.setYsjz_o(vFactorA[3][0]);
			dsq.setYsjz_ave(vFactorA[3][1]);
			dsq.setYsjz_d(vDoctorIdeaA[3]);

			dsq.setZtcfy_a(vAppraise);

			result.setObject(dsq);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 六十五、应付方式问卷（Yffs）共62(124)题，但每题可能要选择2个答案
	private static ClsAnswerResult GetYffsFactorScore(ClsAnswerRequest answer) {
		// 1解决问题，2合理化，3自责，4求助，5幻想，6退避(分“倾向性”和“有效性”)
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 124;

			int intI;
			// 转换回原来格式
			String[] strTemp = answer.getAnswer().split("\\|");
			for (intI = 0; intI < strTemp.length; intI++) {
				if (strTemp[intI].length() == 1) {
					strTemp[intI] = strTemp[intI] + "&0";
				}
			}

			String strAnswerTemp = "";
			for (intI = 0; intI < strTemp.length; intI++) {
				strAnswerTemp += strTemp[intI] + "|";
			}

			if (strAnswerTemp.length() > 0) {
				strAnswerTemp = strAnswerTemp.substring(0, strAnswerTemp.length() - 1).replaceAll("&", "|");
			}

			String[] strAnswer_c = strAnswerTemp.split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共一组，1,0,1,2,0
			String[] strNumberA = { "1,2,3,5,8,29,31,40,46,51,55", "6,9,18,20,30,33,38,52,54,58,61",
					"15,23,25,37,39,48,50,56,57,59", "10,11,14,43,53,60,62", "4,12,17,21,22,26,28,41,45,49",
					"7,13,16,19,24,27,32,35,44,47" };
			int[] intScoreA = { 1, 2, 0 };
			// 第19,39,36,42要特殊处理
			String[] strSubA;

			float[][] vFactorA = new float[6][2]; // 实际为6个因子(倾向性，有效性)
			for (i = 0; i < vFactorA.length; i++) {
				for (j = 0; j < vFactorA[0].length; j++) {
					vFactorA[i][j] = 0;
				}
			}

			// 因子得分
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactorA[i][0] += 2 - Integer.valueOf(sAnswer[(Integer.valueOf(strSubA[j]) - 1) * 2]);
					if (Integer.valueOf(sAnswer[(Integer.valueOf(strSubA[j]) - 1) * 2]) == 1) // 2006-06-30
					// 选1，后面才计分
					{
						vFactorA[i][1] += intScoreA[Integer.valueOf(sAnswer[(Integer.valueOf(strSubA[j]) - 1) * 2 + 1])
								- 1];
					}
				}
			}
			// “求助”：36,42
			int[] intNumA = { 36, 42 };
			for (i = 0; i < intNumA.length; i++) {
				vFactorA[3][0] += Integer.valueOf(sAnswer[(intNumA[i] - 1) * 2]) - 1;
				if (Integer.valueOf(sAnswer[(intNumA[i] - 1) * 2]) == 2) // 2006-06-30
				// 选2，后面才计分
				{
					vFactorA[3][1] += intScoreA[Integer.valueOf(sAnswer[(intNumA[i] - 1) * 2 + 1]) - 1];
				}
			}
			// 特殊处理19
			if (Integer.valueOf(sAnswer[18 * 2]) == 2) {
				vFactorA[0][0] += 1;
				vFactorA[0][1] += intScoreA[Integer.valueOf(sAnswer[18 * 2 + 1]) - 1];
			}
			// 特殊处理39
			if (Integer.valueOf(sAnswer[38 * 2]) == 2) {
				vFactorA[3][0] += 1;
				vFactorA[3][1] += intScoreA[Integer.valueOf(sAnswer[38 * 2 + 1]) - 1];
			}
			// 最后的得分
			// “有效性”
			// “倾向性”，实际为“平均分”
			int[] intAmount = { 12, 11, 10, 10, 10, 10 };
			for (i = 0; i < intAmount.length; i++) {
				BigDecimal bd = new BigDecimal(vFactorA[i][1] / (vFactorA[i][0] <= 0 ? 1 : vFactorA[i][0]));
				vFactorA[i][1] = bd.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();

				BigDecimal bd1 = new BigDecimal(vFactorA[i][0] / intAmount[i]);
				vFactorA[i][0] = bd1.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
			}

			ClsScore.Yffs yffs = new ClsScore.Yffs();

			yffs.setJjwt_t(vFactorA[0][0]);
			yffs.setJjwt_v(vFactorA[0][1]);

			yffs.setHlh_t(vFactorA[1][0]);
			yffs.setHlh_v(vFactorA[1][1]);

			yffs.setZz_t(vFactorA[2][0]);
			yffs.setZz_v(vFactorA[2][1]);

			yffs.setQz_t(vFactorA[3][0]);
			yffs.setQz_v(vFactorA[3][1]);

			yffs.setHx_t(vFactorA[4][0]);
			yffs.setHx_v(vFactorA[4][1]);

			yffs.setTb_t(vFactorA[5][0]);
			yffs.setTb_v(vFactorA[5][1]);

			result.setObject(yffs);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 六十六、生活事件量表（Les）共65题
	private static ClsAnswerResult GetLesFactorScore(ClsAnswerRequest answer) {
		// 1负性事件，2正性事件，3中性事件，4总分，5学习，6婚姻，7健康，8家庭，9工作与经济，10人际关系，11环境问题，12法律与政治
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 65;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共一组，“频度”1,0，“强度”选1在程序中计算得出,选2-0
			// 4“总分”是所有65的题目总和，以“空值”列出
			String[] strNumberA = {
					"1,2,3,4,5,6,8,9,10,11,12,13,15,16,18,21,22,24,26,29,33,34,35,36,37,38,39,40,41,42,43,44,45,48,49,50,51,53,54,55,56,59,61,62,63,64",
					"7,14,19,20,23,25,27,28,30,31,32,47,57", "17,46,52,58,60,65", "", "29,39,44,53,60",
					"4,6,14,16,17,23,25,34,45", "1,2,3,10,11,21,28,54,64", "5,7,13,26,27,32,47,55,61",
					"8,18,19,22,30,33,37,38,42,43,49,50,51,52,57", "36,40,48,56,62,63", "46,58,59,65",
					"9,12,15,20,24,31,35,41" };
			String[] strSubA;

			float[][] vFactorA = new float[12][2]; // 实际为12个因子(分“频度”和“强度”)
			for (i = 0; i < vFactorA.length; i++) {
				for (j = 0; j < vFactorA[0].length; j++) {
					vFactorA[i][j] = 0;
				}
			}

			// “频度”
			for (i = 0; i < strNumberA.length; i++) {
				if (strNumberA[i].length() > 0) {
					strSubA = strNumberA[i].split(",");
					for (j = 0; j < strSubA.length; j++) {
						vFactorA[i][0] += 2 - Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]);
					}
				}
			}
			// 4总分
			for (i = 0; i < sAnswer.length; i++) {
				vFactorA[3][0] += 2 - Integer.valueOf(sAnswer[i]);
			}
			// “强度”，公式：i=1 to 65, j=1 to 3 vfactora(intGeneLocal(i-1,j-1)) +=
			// intGeneValue(i-1)
			// 因子分布的位置
			int[] intGeneValueA;
			int[][] intGeneLocalA = { { 1, 4, 7 }, { 1, 4, 7 }, { 1, 4, 7 }, { 1, 4, 6 }, { 1, 4, 8 }, { 1, 4, 6 },
					{ 2, 4, 8 }, { 1, 4, 9 }, { 1, 4, 12 }, { 1, 4, 7 }, { 1, 4, 7 }, { 1, 4, 12 }, { 1, 4, 8 },
					{ 2, 4, 6 }, { 1, 4, 12 }, { 1, 4, 6 }, { 3, 4, 6 }, { 1, 4, 9 }, { 2, 4, 9 }, { 2, 4, 12 },
					{ 1, 4, 7 }, { 1, 4, 9 }, { 2, 4, 6 }, { 1, 4, 12 }, { 2, 4, 6 }, { 1, 4, 8 }, { 2, 4, 8 },
					{ 2, 4, 7 }, { 1, 4, 5 }, { 2, 4, 9 }, { 2, 4, 12 }, { 2, 4, 8 }, { 1, 4, 9 }, { 1, 4, 6 },
					{ 1, 4, 12 }, { 1, 4, 10 }, { 1, 4, 9 }, { 1, 4, 9 }, { 1, 4, 5 }, { 1, 4, 10 }, { 1, 4, 12 },
					{ 1, 4, 9 }, { 1, 4, 9 }, { 1, 4, 5 }, { 1, 4, 6 }, { 3, 4, 11 }, { 2, 4, 8 }, { 1, 4, 10 },
					{ 1, 4, 9 }, { 1, 4, 9 }, { 1, 4, 9 }, { 3, 4, 9 }, { 1, 4, 5 }, { 1, 4, 7 }, { 1, 4, 8 },
					{ 1, 4, 10 }, { 2, 4, 9 }, { 3, 4, 11 }, { 1, 4, 11 }, { 3, 4, 5 }, { 1, 4, 8 }, { 1, 4, 10 },
					{ 1, 4, 10 }, { 1, 4, 7 }, { 3, 4, 11 } };

			float sngAge = answer.getAge();
			if (sngAge < 30) {
				int[] arrGeneValue = { 113, 102, 110, 65, 73, 64, 62, 61, 49, 60, 56, 47, 51, 50, 43, 55, 48, 43, 43,
						41, 42, 42, 45, 36, 42, 34, 29, 44, 41, 28, 29, 34, 36, 42, 31, 37, 32, 29, 44, 40, 32, 28, 31,
						38, 30, 22, 32, 36, 25, 23, 18, 25, 26, 25, 23, 21, 26, 20, 20, 20, 17, 16, 16, 12, 12 };
				intGeneValueA = arrGeneValue;
			} else if (30 <= sngAge && sngAge < 50) {
				int[] arrGeneValue = { 112, 106, 95, 68, 58, 60, 60, 52, 59, 52, 53, 52, 52, 50, 53, 45, 52, 50, 49, 46,
						43, 41, 36, 43, 40, 44, 44, 38, 39, 44, 41, 41, 38, 36, 40, 37, 38, 40, 30, 33, 35, 38, 34, 29,
						34, 36, 32, 28, 31, 30, 28, 27, 25, 26, 25, 27, 25, 23, 21, 21, 20, 20, 20, 19, 18 };
				intGeneValueA = arrGeneValue;
			} else if (50 <= sngAge && sngAge < 60) {
				int[] arrGeneValue = { 100, 97, 81, 61, 53, 53, 49, 54, 62, 44, 48, 51, 47, 50, 54, 44, 41, 49, 47, 51,
						46, 47, 38, 42, 36, 44, 52, 33, 41, 47, 53, 39, 36, 32, 42, 35, 40, 43, 33, 28, 34, 42, 39, 30,
						29, 39, 29, 25, 35, 32, 35, 26, 23, 25, 29, 23, 23, 32, 25, 22, 20, 21, 19, 21, 18 };
				intGeneValueA = arrGeneValue;
			} else {
				int[] arrGeneValue = { 104, 84, 60, 60, 54, 56, 48, 74, 80, 32, 37, 71, 46, 50, 53, 42, 39, 53, 47, 47,
						46, 40, 57, 43, 35, 29, 39, 27, 26, 40, 59, 33, 34, 19, 36, 33, 33, 34, 33, 26, 37, 23, 31, 26,
						28, 25, 16, 23, 38, 20, 29, 25, 17, 23, 19, 30, 14, 25, 14, 16, 19, 17, 16, 25, 22 };
				intGeneValueA = arrGeneValue;
			}

			// 计算各因子的“强度”分
			for (i = 0; i < intGeneLocalA.length; i++) {
				if (Integer.valueOf(sAnswer[i]) == 1) {
					for (j = 0; j < intGeneLocalA[0].length; j++) {
						vFactorA[intGeneLocalA[i][j] - 1][1] += intGeneValueA[i];
					}
				}
			}

			ClsScore.Les les = new ClsScore.Les();

			les.setFxsj_f(vFactorA[0][0]);
			les.setFxsj_i(vFactorA[0][1]);

			les.setExsj_f(vFactorA[1][0]);
			les.setExsj_i(vFactorA[1][1]);

			les.setZxsj_f(vFactorA[2][0]);
			les.setZxsj_i(vFactorA[2][1]);

			les.setTotal_f(vFactorA[3][0]);
			les.setTotal_i(vFactorA[3][1]);

			les.setXx_f(vFactorA[4][0]);
			les.setXx_i(vFactorA[4][1]);

			les.setHy_f(vFactorA[5][0]);
			les.setHy_i(vFactorA[5][1]);

			les.setJk_f(vFactorA[6][0]);
			les.setJk_i(vFactorA[6][1]);

			les.setJt_f(vFactorA[7][0]);
			les.setJt_i(vFactorA[7][1]);

			les.setGzyjj_f(vFactorA[8][0]);
			les.setGzyjj_i(vFactorA[8][1]);

			les.setRjgx_f(vFactorA[9][0]);
			les.setRjgx_i(vFactorA[9][1]);

			les.setHjwt_f(vFactorA[10][0]);
			les.setHjwt_i(vFactorA[10][1]);

			les.setFlyzz_f(vFactorA[11][0]);
			les.setFlyzz_i(vFactorA[11][1]);

			result.setObject(les);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 六十七、社会支持评定量表（Issi）共14题
	private static ClsAnswerResult GetIssiFactorScore(ClsAnswerRequest answer) {
		// 注：在报告中有“其他物质帮助来源”，“其他精神支持来源”，但不需要计分
		// 1客观支持分，2主观支持分，3对支持的利用度，4总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 14;

			int intI;

			// 转换回原来格式
			String[] strTemp1 = answer.getAnswer().split(g_nChar);
			String strAnswer10 = strTemp1[9].split("&")[0];
			String strAnswer11 = strTemp1[10].split("&")[0];
			String strAnswer10_Other1 = "";
			if (strTemp1[9].split("&").length > 1) {
				if (!strTemp1[9].split("&")[1].equals("@")) {
					strAnswer10_Other1 = strTemp1[9].split("&")[1].split("@")[0];
				}
			}

			String strAnswer10_Other2 = "";
			if (strTemp1[9].split("@").length > 1) {
				strAnswer10_Other2 = strTemp1[9].split("@")[1];
			}

			if (strAnswer10_Other1.equals("")) {
				strAnswer10_Other1 = "0|0|0|0|0|0|0|0|0|" + strAnswer10_Other2;
			} else {
				String[] strAnswer10_Other1_Temp = { "0", "0", "0", "0", "0", "0", "0", "0", "0" };
				for (intI = 0; intI < strAnswer10_Other1.split("\\$").length; intI++) {
					strAnswer10_Other1_Temp[Integer.valueOf(String.valueOf(strAnswer10_Other1.split("\\$")[intI]))
							- 1] = "1";
				}
				strAnswer10_Other1 = "";
				for (intI = 0; intI < strAnswer10_Other1_Temp.length; intI++) {
					strAnswer10_Other1 += strAnswer10_Other1_Temp[intI] + "|";
				}
				strAnswer10_Other1 += strAnswer10_Other2;
			}

			String strAnswer11_Other1 = "";
			if (strTemp1[10].split("&").length > 1) {
				if (!strTemp1[10].split("&")[1].equals("@")) {
					strAnswer11_Other1 = strTemp1[10].split("&")[1].split("@")[0];
				}
			}

			String strAnswer11_Other2 = "";
			if (strTemp1[10].split("$@").length > 1) {
				strAnswer11_Other2 = strTemp1[10].split("$@")[1];
			}

			if (strAnswer11_Other1.equals("")) {
				strAnswer11_Other1 = "0|0|0|0|0|0|0|0|0|" + strAnswer11_Other2;
			} else {
				String[] strAnswer11_Other1_Temp = { "0", "0", "0", "0", "0", "0", "0", "0", "0" };
				for (intI = 0; intI < strAnswer11_Other1.split("\\$").length; intI++) {
					strAnswer11_Other1_Temp[Integer.valueOf(strAnswer11_Other1.split("\\$")[intI]) - 1] = "1";
				}
				strAnswer11_Other1 = "";
				for (intI = 0; intI < strAnswer11_Other1_Temp.length; intI++) {
					strAnswer11_Other1 += strAnswer11_Other1_Temp[intI] + "|";
				}
				strAnswer11_Other1 += strAnswer11_Other2;
			}

			String strTemp = "";
			for (intI = 0; intI < strTemp1.length; intI++) {
				switch (intI) {
				case 9:
					strTemp += strAnswer10 + "|";
					break;
				case 10:
					strTemp += strAnswer11 + "|";
					break;
				default:
					strTemp += strTemp1[intI] + "|";
					break;
				}
			}

			strTemp = strTemp.substring(0, strTemp.length() - 1) + "@@" + strAnswer10_Other1 + "@@"
					+ strAnswer11_Other1;

			// 临时赋值，JAVA默认切割时为空就不增加数组长度
			String[] strAnswer_c_Temp = strTemp.split(g_sChar);
			String[] strAnswer_c = { "", "", "" };
			for (intI = 0; intI < strAnswer_c_Temp.length; intI++) {
				strAnswer_c[intI] = strAnswer_c_Temp[intI].trim();
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共一组，1,2,3,4
			// 第10,11题是多选，选几个，就得几分（特殊处理）
			String[] strNumberA = { "2", "1,3,4,5,6,7,8,9", "12,13,14" };
			String[] strSubA;

			String[] vDoctorIdeaA = new String[4]; // 按原始分得到“指导意见”

			int[] vFactorA = new int[4]; // 实际为4个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}
			// 由于“答案”中可能有特殊的内容，要进行分割 2006-07-20
			// 正确的应该分出三份内容，第一份是答案，第二份是第10题多选，第三份是第11题多选
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactorA[i] += Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]);
				}
			}
			// 第10题和第11题，选择了“有来源”
			for (i = 1; i < 3; i++) {
				if (Integer.valueOf(sAnswer[8 + i]) == 2) {
					strSubA = strAnswer_c[i].split(g_nChar);
					for (j = 0; j < 9; j++) {
						if (Integer.valueOf(strSubA[j]) == 1) {
							vFactorA[0] += 1;
						}
					}
				}
			}

			// 总分
			vFactorA[3] = vFactorA[0] + vFactorA[1] + vFactorA[2];

			// 按原始分得到“指导意见”
			int[][] intValueA = { { 7, 9, 13, 15 }, { 9, 11, 14, 16 }, { 4, 5, 9, 10 } };
			for (i = 0; i < intValueA.length; i++) {
				vDoctorIdeaA[i] = "Issi." + String.valueOf(i + 1) + ".5";
				for (j = 0; j < intValueA[0].length; j++) {
					if (vFactorA[i] <= intValueA[i][j]) {
						vDoctorIdeaA[i] = "Issi." + String.valueOf(i + 1) + "." + String.valueOf(j + 1);
						break;
					}
				}
			}

			ClsScore.Issi issi = new ClsScore.Issi();

			issi.setKgzc_o(vFactorA[0]);
			issi.setKgzc_d(vDoctorIdeaA[0]);

			issi.setZgzc_o(vFactorA[1]);
			issi.setZgzc_d(vDoctorIdeaA[1]);

			issi.setZclyd_o(vFactorA[2]);
			issi.setZclyd_d(vDoctorIdeaA[2]);

			issi.setTotal_o(vFactorA[3]);

			result.setObject(issi);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 六十八、简易应对方式（Jyyd）共20题
	private static ClsAnswerResult GetJyydFactorScore(ClsAnswerRequest answer) {
		// 1积极应对，2消极应对
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 20;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;
			// 共一组，0,1,2,3

			int[] vFactorA = new int[2]; // 实际为2个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			j = 0;
			for (i = 0; i < sAnswer.length; i++) {
				if (i == 12) {
					j = 1;
				}
				vFactorA[j] += Integer.valueOf(sAnswer[i]) - 1;
			}

			ClsScore.Jyyd jyyd = new ClsScore.Jyyd();

			jyyd.setJjyd_o(vFactorA[0]);
			jyyd.setXjyd_o(vFactorA[1]);

			result.setObject(jyyd);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 六十九、家庭环境量表（Fes）共90题
	private static ClsAnswerResult GetFesFactorScore(ClsAnswerRequest answer) {
		// 1亲密度，2情感表达，3矛盾性，4独立性，5成功性，6知识性，7娱乐性，8道德宗教观，9组织性，10控制性
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 90;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j, k;

			// 共二组，第一组0,1，第二组1,0
			String[][] strNumberA = {
					{ "11,41,61", "2,22,52,72", "13,33,63", "4,54", "55,65", "16,36,46,76", "7,27,57,87", "18,38,88",
							"29,49,79", "10,20,60,70" },
					{ "1,21,31,51,71,81", "12,32,42,62,82", "3,23,43,53,73,83", "14,24,34,44,64,74,84",
							"5,15,25,35,45,75,85", "6,26,56,66,86", "17,37,47,67,77", "8,28,48,58,68,78",
							"9,19,39,59,69,89", "30,40,50,80,90" } };
			String[] strSubA;
			int[][] intScoreA = { { 0, 1 }, { 1, 0 } };

			String[] vDoctorIdeaA = new String[10]; // 按原始分得到“指导意见”

			int[] vFactorA = new int[10]; // 实际为10个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			// 原始分
			for (i = 0; i < strNumberA.length; i++) {
				for (j = 0; j < strNumberA[0].length; j++) {
					strSubA = strNumberA[i][j].split(",");
					for (k = 0; k < strSubA.length; k++) {
						vFactorA[j] += intScoreA[i][Integer.valueOf(sAnswer[Integer.valueOf(strSubA[k]) - 1]) - 1];
					}
				}
			}

			// 按原始分得到“指导意见”
			float[][] sngValueA = { { 5.8f, 7.6f }, { 3.1f, 5.7f }, { 1.9f, 2.1f }, { 4.4f, 5.7f }, { 5.1f, 6.7f },
					{ 3.5f, 5.5f }, { 2.9f, 4.8f }, { 3.9f, 5.2f }, { 4.9f, 6.6f }, { 1.8f, 3.5f } };
			for (i = 0; i < sngValueA.length; i++) {
				vDoctorIdeaA[i] = "Fes." + String.valueOf(i + 1) + ".3";
				for (j = 0; j < sngValueA[0].length; j++) {
					if (vFactorA[i] <= sngValueA[i][j]) {
						vDoctorIdeaA[i] = "Fes." + String.valueOf(i + 1) + "." + String.valueOf(j + 1);
						break;
					}
				}
			}

			ClsScore.Fes fes = new ClsScore.Fes();

			fes.setQmd_o(vFactorA[0]);
			fes.setQmd_d(vDoctorIdeaA[0]);

			fes.setQgbd_o(vFactorA[1]);
			fes.setQgbd_d(vDoctorIdeaA[1]);

			fes.setMdx_o(vFactorA[2]);
			fes.setMdx_d(vDoctorIdeaA[2]);

			fes.setDlx_o(vFactorA[3]);
			fes.setDlx_d(vDoctorIdeaA[3]);

			fes.setCgx_o(vFactorA[4]);
			fes.setCgx_d(vDoctorIdeaA[4]);

			fes.setZsx_o(vFactorA[5]);
			fes.setZsx_d(vDoctorIdeaA[5]);

			fes.setYlx_o(vFactorA[6]);
			fes.setYlx_d(vDoctorIdeaA[6]);

			fes.setDdzjg_o(vFactorA[7]);
			fes.setDdzjg_d(vDoctorIdeaA[7]);

			fes.setZzx_o(vFactorA[8]);
			fes.setZzx_d(vDoctorIdeaA[8]);

			fes.setKzx_o(vFactorA[9]);
			fes.setKzx_d(vDoctorIdeaA[9]);

			result.setObject(fes);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 七十、OLSON婚姻质量问卷（Olson）共124题
	private static ClsAnswerResult GetOlsonFactorScore(ClsAnswerRequest answer) {
		// 1总分，2过份理想化，3婚姻满意度，4性格相容性，5夫妻交流，6解决冲突的方式，7经济安排，8业余活动，
		// 9性生活，10子女和婚姻，11与亲友的关系，12角色平等性，13信仰一致性
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 124;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j, k;

			// 总分由各因子相加得到
			// 共二组，第一组：1,2,3,4,5；第二组5,4,3,2,1
			String[][] strNumberA = { { "64,70,101,117,118,123", "14,32,52,53,88,99", "8,13,24,30,37,44,63,78,95,115",
					"6,40,54,66,73,81,98", "4,10,71,74,79,96,112", "16,26,77,85,93,110", "17,18,28,72,84",
					"25,47,69,106,111", "5,49,59,87,94", "7,48,57,86,90,92", "12,29,43,55,61,75,97,105", "3,56,100" },
					{ "34,42,116,119,120,121,122,124", "19,36,82,113", "", "2,91,109", "39,58,83", "20,38,45,51",
							"1,31,33,60,114", "9,15,41,62,107", "21,35,50,67,102", "27,68,103,108", "23,80",
							"11,22,46,65,76,89,104" } };
			int[][] intScoreA = { { 1, 2, 3, 4, 5 }, { 5, 4, 3, 2, 1 } };
			String[] strSubA;

			String[] vDoctorIdeaA = new String[13]; // 按“原始分”得到“指导意见”

			float[][] vFactorA = new float[13][2]; // 实际为13个因子(分“原始分”和“标准分”)
			for (i = 0; i < vFactorA.length; i++) {
				for (j = 0; j < vFactorA[0].length; j++) {
					vFactorA[i][j] = 0;
				}
			}

			// “原始分”
			for (i = 0; i < strNumberA.length; i++) {
				for (j = 0; j < strNumberA[0].length; j++) {
					if (strNumberA[i][j].length() > 0) {
						strSubA = strNumberA[i][j].split(",");
						for (k = 0; k < strSubA.length; k++) {
							vFactorA[j + 1][0] += intScoreA[i][Integer.valueOf(sAnswer[Integer.valueOf(strSubA[k]) - 1])
									- 1];
							// vFactorA(j + 1, 0) += intScoreA(i,
							// CInt(sAnswer(CInt(strSubA(k)) - 1)) - 1)
						}
					}
				}
			}

			// 1总分
			for (i = 1; i < vFactorA.length; i++) {
				vFactorA[0][0] += vFactorA[i][0];
			}

			// “标准分”公式：Standard(i) = 50 + (Original(i) – arrMinus(i)) * 10 /
			// arrDivisor(i)
			// “总分”没有“标准分”
			// int[][] intGeneValueA;
			float[][] intGeneValueA;
			int intSex = answer.getSex();
			if (intSex == 1) {
				float[][] arrGeneValue = { { 6.3f, 7.9f }, { 37.21f, 6.45f }, { 34.58f, 5.96f }, { 34.9f, 6.05f },
						{ 34.05f, 5.84f }, { 37.16f, 6.33f }, { 33.99f, 3.9f }, { 37.09f, 6.62f }, { 38.35f, 5.58f },
						{ 37.52f, 5.63f }, { 28.86f, 5.45f }, { 39.04f, 6.58f } };
				intGeneValueA = arrGeneValue;
			} else {
				float[][] arrGeneValue = { { 45.98f, 8.01f }, { 37.04f, 7.03f }, { 34.43f, 6.35f }, { 34.1f, 6.94f },
						{ 33.85f, 6.43f }, { 37.65f, 6.78f }, { 34.81f, 4.38f }, { 37.6f, 6.9f }, { 38.25f, 5.72f },
						{ 38.55f, 5.9f }, { 28.08f, 5.8f }, { 40.04f, 6.26f } };
				intGeneValueA = arrGeneValue;
			}

			// 计算各因子的“标准分”
			for (i = 0; i < intGeneValueA.length; i++) {
				BigDecimal bd = new BigDecimal(
						50 + (vFactorA[i + 1][0] - intGeneValueA[i][0]) * 10 / intGeneValueA[i][1]);
				vFactorA[i + 1][1] = bd.setScale(0, BigDecimal.ROUND_HALF_UP).floatValue(); // 这里特殊在把小数去掉了
			}
			// 按“原始分”得到“指导意见”
			// “总分”没有“指导意见”
			int[][] intValueA = { { 42, 54, -1, -1 }, { 20, 30, 37, 43 }, { 20, 29, 35, 40 }, { 20, 28, 35, 40 },
					{ 20, 28, 34, 40 }, { 20, 29, 36, 43 }, { 24, 29, 34, 39 }, { 20, 29, 37, 44 }, { 20, 30, 38, 44 },
					{ 20, 31, 38, 44 }, { 22, 29, 40, -1 }, { 30, 40, -1, -1 } };
			int[] intCode = { 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 3 };
			for (i = 0; i < intValueA.length; i++) {
				vDoctorIdeaA[i + 1] = "Olson." + String.valueOf(i + 1) + "." + intCode[i];
				for (j = 0; j < intValueA[0].length; j++) {
					if (vFactorA[i + 1][0] <= intValueA[i][j]) {
						vDoctorIdeaA[i + 1] = "Olson." + String.valueOf(i + 1) + "." + String.valueOf(j + 1);
						break;
					}
				}
			}

			ClsScore.Olson olson = new ClsScore.Olson();

			olson.setTotal_o(vFactorA[0][0]);

			olson.setGflxh_o(vFactorA[1][0]);
			olson.setGflxh_s(vFactorA[1][1]);
			olson.setGflxh_d(vDoctorIdeaA[1]);

			olson.setHymyd_o(vFactorA[2][0]);
			olson.setHymyd_s(vFactorA[2][1]);
			olson.setHymyd_d(vDoctorIdeaA[2]);

			olson.setXgxrx_o(vFactorA[3][0]);
			olson.setXgxrx_s(vFactorA[3][1]);
			olson.setXgxrx_d(vDoctorIdeaA[3]);

			olson.setFqjl_o(vFactorA[4][0]);
			olson.setFqjl_s(vFactorA[4][1]);
			olson.setFqjl_d(vDoctorIdeaA[4]);

			olson.setJjct_o(vFactorA[5][0]);
			olson.setJjct_s(vFactorA[5][1]);
			olson.setJjct_d(vDoctorIdeaA[5]);

			olson.setJjap_o(vFactorA[6][0]);
			olson.setJjap_s(vFactorA[6][1]);
			olson.setJjap_d(vDoctorIdeaA[6]);

			olson.setYyhd_o(vFactorA[7][0]);
			olson.setYyhd_s(vFactorA[7][1]);
			olson.setYyhd_d(vDoctorIdeaA[7]);

			olson.setXsh_o(vFactorA[8][0]);
			olson.setXsh_s(vFactorA[8][1]);
			olson.setXsh_d(vDoctorIdeaA[8]);

			olson.setZnhhy_o(vFactorA[9][0]);
			olson.setZnhhy_s(vFactorA[9][1]);
			olson.setZnhhy_d(vDoctorIdeaA[9]);

			olson.setYqygx_o(vFactorA[10][0]);
			olson.setYqygx_s(vFactorA[10][1]);
			olson.setYqygx_d(vDoctorIdeaA[10]);

			olson.setJspdx_o(vFactorA[11][0]);
			olson.setJspdx_s(vFactorA[11][1]);
			olson.setJspdx_d(vDoctorIdeaA[11]);

			olson.setXyyzx_o(vFactorA[12][0]);
			olson.setXyyzx_s(vFactorA[12][1]);
			olson.setXyyzx_d(vDoctorIdeaA[12]);

			result.setObject(olson);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 七十一、生活满意度量表（Lsr）共5题
	private static ClsAnswerResult GetLsrFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 5;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i;
			// 共一组，5,4,3,2,1

			int vFactor = 0; // 实际为1个因子

			// 总分
			for (i = 0; i < sAnswer.length; i++) {
				vFactor += 6 - Integer.valueOf(sAnswer[i]);
			}

			// 按总分得到“诊断结果”
			// 按总分得到“指导意见”
			int[] intValueA = { 19, 12 };
			String[] strValueA = { "满意", "一般", "不满意" };
			String vAppraise = strValueA[strValueA.length - 1];
			String vDoctorIdea = "Lsr.1.3";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactor >= intValueA[i]) {
					vAppraise = strValueA[i];
					vDoctorIdea = "Lsr.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Lsr lsr = new ClsScore.Lsr();

			lsr.setTotal_o(vFactor);
			lsr.setTotal_a(vAppraise);
			lsr.setTotal_d(vDoctorIdea);

			result.setObject(lsr);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 七十二、生活满意度指数A（Lsia）共20题
	private static ClsAnswerResult GetLsiaFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 20;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共二组，第一组：1,0,0；第二组：0,1,0
			String[] strNumberA = { "1,2,4,6,8,9,11,12,13,15,16,19", "3,5,7,10,14,17,18,20" };
			int[][] intScoreA = { { 1, 0, 0 }, { 0, 1, 0 } };
			String[] strSubA;

			int vFactor = 0; // 实际为1个因子

			// 总分
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactor += intScoreA[i][Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]) - 1];
				}
			}

			// 按总分得到“指导意见”
			int[] intValueA = { 13, 8 };
			String vDoctorIdea = "Lsia.1.3";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactor >= intValueA[i]) {
					vDoctorIdea = "Lsia.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Lsia lsia = new ClsScore.Lsia();

			lsia.setTotal_o(vFactor);
			lsia.setTotal_d(vDoctorIdea);

			result.setObject(lsia);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 七十三、生活满意度指数B（Lsib）共12题
	private static ClsAnswerResult GetLsibFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 12;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共三组，第一组：1,0,0；第二组：2,0,0；第三组：2,1,0
			String[] strNumberA = { "1", "6", "2,3,4,5,7,8,9,10,11,12" };
			int[][] intScoreA = { { 1, 0, 0 }, { 2, 0, 0 }, { 2, 1, 0 } };
			String[] strSubA;

			int vFactor = 0; // 实际为1个因子
			// 总分
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactor += intScoreA[i][Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]) - 1];
				}
			}

			// 按总分得到“指导意见”
			int[] intValueA = { 13, 8 };
			String vDoctorIdea = "Lsib.1.3";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactor >= intValueA[i]) {
					vDoctorIdea = "Lsib.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Lsib lsib = new ClsScore.Lsib();

			lsib.setTotal_o(vFactor);
			lsib.setTotal_d(vDoctorIdea);

			result.setObject(lsib);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 七十四、情感量表（Motion）共10题
	private static ClsAnswerResult GetMotionFactorScore(ClsAnswerRequest answer) {
		// 1正性情感，2负性情感，3情感平衡
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 10;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共一组，1,0
			int[][] intNumberA = { { 1, 3, 5, 7, 9 }, { 2, 4, 6, 8, 10 } };

			int[] vFactorA = new int[3]; // 实际为3个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			// 原始分
			for (i = 0; i < intNumberA.length; i++) {
				for (j = 0; j < intNumberA[0].length; j++) {
					vFactorA[i] += 2 - Integer.valueOf(sAnswer[intNumberA[i][j] - 1]);
				}
			}
			vFactorA[2] = vFactorA[0] - vFactorA[1] + 5;

			// 按总分得到“指导意见”
			int[] intValueA = { 7, 4 };
			String vDoctorIdea = "Motion.1.3";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactorA[2] >= intValueA[i]) {
					vDoctorIdea = "Motion.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Motion motion = new ClsScore.Motion();

			motion.setZxqg_o(vFactorA[0]);
			motion.setFxqg_o(vFactorA[1]);
			motion.setQgph_o(vFactorA[2]);
			motion.setQgph_d(vDoctorIdea);

			result.setObject(motion);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 七十五、总体幸福感量表（Gwb）共33题 ****
	private static ClsAnswerResult GetGwbFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 33;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共五组，第一组1,2,3,4,5,6,7,8,9,10；第二组6,5,4,3,2,1；第三组5,4,3,2,1；第四组10,9,8,7,6,5,4,3,2,1,0；第五组0,1,2,3,4,5,6,7,8,9,10
			String[] strNumberA = { "2,4,5,8,10,12,14,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33", "1,3,9,11,13",
					"6,7", "15,16", "17,18" };
			String[] strSubA;
			int[][] intScoreA = { { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0 }, { 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0 },
					{ 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0 }, { 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 },
					{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } };

			int vFactor = 0; // 实际为1个因子

			// 总分
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactor += intScoreA[i][Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]) - 1];
				}
			}

			// 按总分得到“指导意见”
			int[] intValueA = { 102, 87 };
			String vDoctorIdea = "Gwb.1.3";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactor >= intValueA[i]) {
					vDoctorIdea = "Gwb.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Gwb gwb = new ClsScore.Gwb();

			gwb.setTotal_o(vFactor);
			gwb.setTotal_d(vDoctorIdea);

			result.setObject(gwb);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 七十六、健康状况问卷（Sf36）（Hsq）共36题
	private static ClsAnswerResult GetSf36FactorScore(ClsAnswerRequest answer) {
		// 1生理机能，2生理职能，3躯体疼痛，4一般健康状况，5精力，6社会功能，7情感职能，8精神健康
		// “健康变化情况”不是计分因子，将其计入“诊断结果”
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 36;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 计分比较复杂，使用程序判断计分
			// 弃权题数
			int[] intDrop = new int[8];
			// 拼凑计分
			int[] intPast = new int[8];

			float[][] vFactorA = new float[8][2]; // 实际为8个因子(分“原始分”和“标准分”)
			for (i = 0; i < vFactorA.length; i++) {
				for (j = 0; j < vFactorA[0].length; j++) {
					vFactorA[i][j] = 0;
				}
			}

			// “原始分”
			// 1“生理机能”3-12，1,2,3,1
			for (i = 2; i < 12; i++) {
				if (Integer.valueOf(sAnswer[i]) <= 3) {
					vFactorA[0][0] += Integer.valueOf(sAnswer[i]);
				} else {
					intDrop[0] += 1;
				}
			}
			// 2“生理职能”13-16，1,2,1
			for (i = 12; i < 16; i++) {
				if (Integer.valueOf(sAnswer[i]) <= 2) {
					vFactorA[1][0] += Integer.valueOf(sAnswer[i]);
				} else {
					intDrop[1] += 1;
				}
			}
			// 3“躯体疼痛”21，6,5.4,4.2,3.1,2.2,1；22使用程序计分
			float[] sngScoreThreeOneA = { 6f, 5.4f, 4.2f, 3.1f, 2.2f, 1f, 0f };
			vFactorA[2][0] += sngScoreThreeOneA[Integer.valueOf(sAnswer[20]) - 1];
			float[] sngScoreThreeTwoA = { 6f, 4.75f, 3.5f, 2.25f, 1f, 0f, 0f };
			if (Integer.valueOf(sAnswer[21]) == 1) {
				if (Integer.valueOf(sAnswer[20]) >= 2 && Integer.valueOf(sAnswer[20]) <= 6) {
					vFactorA[2][0] += 6 - Integer.valueOf(sAnswer[21]);
				} else {
					vFactorA[2][0] += sngScoreThreeTwoA[Integer.valueOf(sAnswer[21]) - 1];
				}
			} else {
				if (Integer.valueOf(sAnswer[20]) <= 6) {
					vFactorA[2][0] += 6 - Integer.valueOf(sAnswer[21]);
				} else {
					vFactorA[2][0] += sngScoreThreeTwoA[Integer.valueOf(sAnswer[21]) - 1];
				}
			}

			// 4“一般健康状况”1程序计分；33,35，1,2,3,4,5,1；34,36，5,4,3,2,1,1
			float[] sngScoreFourA = { 5f, 4.4f, 3.4f, 2f, 1f, 0f, 0f };
			if (Integer.valueOf(sAnswer[0]) <= 5) {
				vFactorA[3][0] += sngScoreFourA[Integer.valueOf(sAnswer[0]) - 1];
				intPast[3] += sngScoreFourA[Integer.valueOf(sAnswer[0]) - 1];
			} else {
				intDrop[3] += 1;
			}
			for (i = 0; i < 3; i += 2) // Step 2
			{
				if (Integer.valueOf(sAnswer[i + 32]) <= 5) {
					vFactorA[3][0] += Integer.valueOf(sAnswer[i + 32]);
				} else {
					intDrop[3] += 1;
				}
			}
			for (i = 0; i < 3; i += 2) // Step 2
			{
				if (Integer.valueOf(sAnswer[i + 33]) <= 5) {
					vFactorA[3][0] += 6 - Integer.valueOf(sAnswer[i + 33]);
				} else {
					intDrop[3] += 1;
				}
			}
			// 5“精力”23,27,29,31，6,5,4,3,2,1,1
			int[] intNumberFiveA = { 23, 27, 29, 31 };
			for (i = 0; i < intNumberFiveA.length; i++) {
				if (Integer.valueOf(sAnswer[intNumberFiveA[i] - 1]) <= 6) {
					vFactorA[4][0] += 7 - Integer.valueOf(sAnswer[intNumberFiveA[i] - 1]);
				} else {
					intDrop[4] += 1;
				}
			}
			// 6“社会功能”20，5,4,3,2,1,1；32，1,2,3,3,4,5,1
			if (Integer.valueOf(sAnswer[19]) <= 5) {
				vFactorA[5][0] += 6 - Integer.valueOf(sAnswer[19]);
			} else {
				intDrop[5] += 1;
			}
			int[] intScoreSixA = { 1, 2, 3, 3, 4, 5 };
			if (Integer.valueOf(sAnswer[31]) <= 6) {
				vFactorA[5][0] += intScoreSixA[Integer.valueOf(sAnswer[31]) - 1];
			} else {
				intDrop[5] += 1;
			}
			// 7“情感职能”17-19，1,2,1
			for (i = 0; i < 3; i++) {
				if (Integer.valueOf(sAnswer[i + 16]) <= 2) {
					vFactorA[6][0] += Integer.valueOf(sAnswer[i + 16]);
				} else {
					intDrop[6] += 1;
				}
			}
			// 8“精神健康”24,25,28，1,2,3,4,5,6,1；26,30，6,5,4,3,2,1,1
			int[] intNumberEightOneA = { 24, 25, 28 };
			for (i = 0; i < intNumberEightOneA.length; i++) {
				if (Integer.valueOf(sAnswer[intNumberEightOneA[i] - 1]) <= 6) {
					vFactorA[7][0] += Integer.valueOf(sAnswer[intNumberEightOneA[i] - 1]);
				} else {
					intDrop[7] += 1;
				}
			}
			int[] intNumberEightTwoA = { 26, 30 };
			for (i = 0; i < intNumberEightTwoA.length; i++) {
				if (Integer.valueOf(sAnswer[intNumberEightTwoA[i] - 1]) <= 6) {
					vFactorA[7][0] += 7 - Integer.valueOf(sAnswer[intNumberEightTwoA[i] - 1]);
				} else {
					intDrop[7] += 1;
				}
			}

			// 最终“原始分”计分，只有“躯体疼痛”使用原计分
			int[] intNumA = { 0, 1, 4, 5, 6, 7 };
			int[] intCountA = { 10, 4, 4, 2, 3, 5 };
			for (i = 0; i < intNumA.length; i++) {
				// If intDrop(intNumA(i)) > Fix(intCountA(i) / 2) Then
				// 原始代码Fix应该是取整数忽略小数的意思，JAVA直接强制转换为int型好像就可以实现
				if (intDrop[intNumA[i]] > (int) (intCountA[i] / 2)) {
					vFactorA[intNumA[i]][0] = 0;
				} else {
					BigDecimal bd = new BigDecimal(
							vFactorA[intNumA[i]][0] / (intCountA[i] - intDrop[intNumA[i]]) * intDrop[intNumA[i]]);
					vFactorA[intNumA[i]][0] += bd.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
				}
			}
			// “一般健康状况”独立计分
			if (intDrop[3] > 2) {
				vFactorA[3][0] = 0;
			} else {
				if (intPast[3] == 0) {
					BigDecimal bd1 = new BigDecimal(vFactorA[3][0] / (5 - intDrop[3]) * intDrop[3]);
					vFactorA[3][0] += bd1.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
				} else {
					BigDecimal bd2 = new BigDecimal((vFactorA[3][0] - intPast[3]) / (4 - intDrop[3]) * intDrop[3]);
					vFactorA[3][0] += bd2.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
				}
			}
			// “标准分”
			int[][] intValueA = { { 10, 4, 2, 5, 4, 2, 3, 5 }, { 20, 4, 10, 20, 20, 8, 3, 25 } };
			for (i = 0; i < intValueA[0].length; i++) {
				if (vFactorA[i][0] <= 0) {
					vFactorA[i][1] = 0;
				} else {
					BigDecimal bd3 = new BigDecimal((vFactorA[i][0] - intValueA[0][i]) / intValueA[1][i] * 100);
					vFactorA[i][1] = bd3.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
					// vFactorA(i, 1) = CInt((vFactorA(i, 0) - intValueA(0, i)) / intValueA(1, i) *
					// 100)
					// 原始代码是转成int型，但是JAVA中Integer.valueOf中的内容只有String或者int类型，所以这里直接用int强制转换
					// vFactorA[i][1] = (int)((vFactorA[i][0] - intValueA[0][i]) / intValueA[1][i] *
					// 100);
				}
			}
			// “健康变化情况”不是计分因子，将其计入“诊断结果”
			String[] strValueA = { "比一年前好多了", "比一年前好一些", "和一年前差不多", "比一年前差一些", "比一年前差多了", "没有回答" };
			int intLocal = 6;
			if (Integer.valueOf(sAnswer[1]) < 6) {
				intLocal = Integer.valueOf(sAnswer[1]);
			}
			String vAppraise = strValueA[intLocal - 1];

			ClsScore.Sf36 sf36 = new ClsScore.Sf36();

			sf36.setSljn_o(vFactorA[0][0]);
			sf36.setSljn_s(vFactorA[0][1]);

			sf36.setSlzn_o(vFactorA[1][0]);
			sf36.setSlzn_s(vFactorA[1][1]);

			sf36.setQttt_o(vFactorA[2][0]);
			sf36.setQttt_s(vFactorA[2][1]);

			sf36.setYbjkzk_o(vFactorA[3][0]);
			sf36.setYbjkzk_s(vFactorA[3][1]);

			sf36.setJl_o(vFactorA[4][0]);
			sf36.setJl_s(vFactorA[4][1]);

			sf36.setShgn_o(vFactorA[5][0]);
			sf36.setShgn_s(vFactorA[5][1]);

			sf36.setQgzn_o(vFactorA[6][0]);
			sf36.setQgzn_s(vFactorA[6][1]);

			sf36.setJsjk_o(vFactorA[7][0]);
			sf36.setJsjk_s(vFactorA[7][1]);

			sf36.setJkbh_a(vAppraise);

			result.setObject(sf36);

			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 七十七、勃起功能障碍指数问卷（Ed）共5题
	private static ClsAnswerResult GetEdFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 5;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i;
			// 共一组：0,1,2,3,4,5

			int vFactor = 0; // 实际为1个因子

			// 总分
			for (i = 0; i < sAnswer.length; i++) {
				vFactor += Integer.valueOf(sAnswer[i]) - 1;
			}

			// 按总分得到“诊断结果”
			int[] intValueA = { 7, 11, 21 };
			String[] strValueA = { "严重ED，医生需要引起关注", "中度ED，医生需要引起关注", "轻度ED，医生需要引起关注", "未患ED" };
			String vAppraise = strValueA[strValueA.length - 1];
			for (i = 0; i < intValueA.length; i++) {
				if (vFactor <= intValueA[i]) {
					vAppraise = strValueA[i];
					break;
				}
			}

			ClsScore.Ed ed = new ClsScore.Ed();

			ed.setTotal_o(vFactor);
			ed.setTotal_a(vAppraise);

			result.setObject(ed);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 七十八、婚姻满意度指数（Spdall）共28题
	private static ClsAnswerResult GetSpdallFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 28;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共二组，第一组：0,1,2,3；第二组：3,2,1,0
			int[][] intNumberA = { { 3, 6, 7, 8, 11, 13, 16, 18, 19, 21, 23, 24, 26, 27 },
					{ 1, 2, 4, 5, 9, 10, 12, 14, 15, 17, 20, 22, 25, 28 } };
			int[][] intScoreA = { { 0, 1, 2, 3 }, { 3, 2, 1, 0 } };

			int vFactor = 0; // 实际为1个因子

			// 总分
			for (i = 0; i < intNumberA.length; i++) {
				for (j = 0; j < intNumberA[0].length; j++) {
					vFactor += intScoreA[i][Integer.valueOf(sAnswer[intNumberA[i][j] - 1]) - 1];
				}
			}

			// 按总分得到“诊断结果”
			int[] intValueA = { 16, 21, 25, 29, 33, 37, 41, 46 };
			String[] strValueA = { "很好", "非常好", "好", "较好", "一般", "较差", "差", "严重", "非常严重" };
			String vAppraise = strValueA[strValueA.length - 1];
			for (i = 0; i < intValueA.length; i++) {
				if (vFactor <= intValueA[i]) {
					vAppraise = strValueA[i];
					break;
				}
			}

			ClsScore.Spdall spdall = new ClsScore.Spdall();

			spdall.setTotal_o(vFactor);
			spdall.setTotal_a(vAppraise);

			result.setObject(spdall);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 七十九、男性性满意度指数（Spdm）共28题
	private static ClsAnswerResult GetSpdmFactorScore(ClsAnswerRequest answer) {
		// 1频率，2无交流，3男性不满足，4男性回避，5男性无性感，6阳痿，7早泄，8总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 28;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j, k;

			// 总分由各因子相加得到
			// 共二组，第一组：0,1,2,3,4；第二组4,3,2,1,0
			String[][] strNumberA = { { "17", "2", "5,11", "7,14,22,28", "6,20", "10,23", "24,27" },
					{ "1", "9", "15,21", "", "12,25", "3,16", "4,13" } };
			int[][] intScoreA = { { 0, 1, 2, 3, 4 }, { 4, 3, 2, 1, 0 } };
			String[] strSubA;

			float[][] vFactorA = new float[8][2]; // 实际为8个因子(分“原始分”和“标准分”)
			for (i = 0; i < vFactorA.length; i++) {
				for (j = 0; j < vFactorA[0].length; j++) {
					vFactorA[i][j] = 0;
				}
			}
			// “原始分”
			for (i = 0; i < strNumberA.length; i++) {
				for (j = 0; j < strNumberA[0].length; j++) {
					if (strNumberA[i][j].length() > 0) {
						strSubA = strNumberA[i][j].split(",");
						for (k = 0; k < strSubA.length; k++) {
							vFactorA[j][0] += intScoreA[i][Integer.valueOf(sAnswer[Integer.valueOf(strSubA[k]) - 1])
									- 1];
						}
					}
				}
			}
			// 8总分
			for (i = 0; i < vFactorA.length - 1; i++) {
				vFactorA[7][0] += vFactorA[i][0];
			}

			// “标准分”
			for (i = 0; i < 2; i++) {
				vFactorA[i][1] = vFactorA[i][0] + 1;
			}
			int[][] intStandardA = { { 2, 3, 5, 7, 9, 11, 12, 13 }, { 0, 1, 2, 3, 5, 7, 9, 11 },
					{ 0, 1, 2, 3, 4, 6, 8, 10 }, { 0, 1, 2, 3, 5, 9, 11, 13 }, { 0, 1, 2, 4, 5, 7, 9, 11 },
					{ 12, 16, 20, 24, 28, 34, 42, 49 } };
			for (i = 0; i < intStandardA.length; i++) {
				vFactorA[i + 2][1] = 9;
				for (j = 0; j < intStandardA[0].length; j++) {
					if (vFactorA[i + 2][0] <= intStandardA[i][j]) {
						vFactorA[i + 2][1] = j + 1;
						break;
					}
				}
			}

			// 只有“总分”有“诊断结果”
			String[] strValueA = { "很好", "非常好", "好", "较好", "一般", "较差", "差", "严重", "非常严重" };
			// vAppraise = strValueA(CInt(vFactorA(7, 1)) - 1)
			// 原始代码是CInt，仔细看了下代码，此处的作用就是强制转换，里面的数据本来就是整数，只是定义时作为float而已
			String vAppraise = strValueA[(int) (vFactorA[7][1]) - 1];

			ClsScore.Spdm spdm = new ClsScore.Spdm();

			spdm.setPl_o(vFactorA[0][0]);
			spdm.setPl_s(vFactorA[0][1]);

			spdm.setWjl_o(vFactorA[1][0]);
			spdm.setWjl_s(vFactorA[1][1]);

			spdm.setNxbmz_o(vFactorA[2][0]);
			spdm.setNxbmz_s(vFactorA[2][1]);

			spdm.setNxhb_o(vFactorA[3][0]);
			spdm.setNxhb_s(vFactorA[3][1]);

			spdm.setNxwxg_o(vFactorA[4][0]);
			spdm.setNxwxg_s(vFactorA[4][1]);

			spdm.setYw_o(vFactorA[5][0]);
			spdm.setYw_s(vFactorA[5][1]);

			spdm.setZx_o(vFactorA[6][0]);
			spdm.setZx_s(vFactorA[6][1]);

			spdm.setTotal_o(vFactorA[7][0]);
			spdm.setTotal_s(vFactorA[7][1]);

			spdm.setTotal_a(vAppraise);

			result.setObject(spdm);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 八十、女性性满意度指数（Spdf）共28题
	private static ClsAnswerResult GetSpdfFactorScore(ClsAnswerRequest answer) {
		// 1频率，2无交流，3女性不满足，4女性回避，5女性无性感，6阴道痉挛，7缺乏性快感，8总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 28;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j, k;

			// 总分由各因子相加得到
			// 共二组，第一组：0,1,2,3,4；第二组4,3,2,1,0
			String[][] strNumberA = { { "3", "16", "18,22", "7,13,20,23", "12,25", "6,24", "14,28" },
					{ "15", "2", "5,10", "", "9,19", "11,17", "8,21" } };
			int[][] intScoreA = { { 0, 1, 2, 3, 4 }, { 4, 3, 2, 1, 0 } };
			String[] strSubA;

			float[][] vFactorA = new float[8][2]; // 实际为8个因子(分“原始分”和“标准分”)
			for (i = 0; i < vFactorA.length; i++) {
				for (j = 0; j < vFactorA[0].length; j++) {
					vFactorA[i][j] = 0;
				}
			}

			// “原始分”
			for (i = 0; i < strNumberA.length; i++) {
				for (j = 0; j < strNumberA[0].length; j++) {
					if (strNumberA[i][j].length() > 0) {
						strSubA = strNumberA[i][j].split(",");
						for (k = 0; k < strSubA.length; k++) {
							vFactorA[j][0] += intScoreA[i][Integer.valueOf(sAnswer[Integer.valueOf(strSubA[k]) - 1])
									- 1];
						}
					}
				}
			}
			// 8总分
			for (i = 0; i < vFactorA.length - 1; i++) {
				vFactorA[7][0] += vFactorA[i][0];
			}
			// “标准分”
			for (i = 0; i < 2; i++) {
				vFactorA[i][1] = vFactorA[i][0] + 1;
			}
			int[][] intStandardA = { { 1, 3, 5, 7, 9, 11, 13, 14 }, { 0, 1, 2, 3, 5, 7, 9, 11 },
					{ 0, 1, 2, 3, 4, 6, 8, 10 }, { 0, 1, 2, 3, 5, 7, 10, 12 }, { 0, 3, 5, 8, 11, 13, 14, 15 },
					{ 20, 25, 30, 37, 45, 52, 59, 67 } };
			for (i = 0; i < intStandardA.length; i++) {
				vFactorA[i + 2][1] = 9;
				for (j = 0; j < intStandardA[0].length; j++) {
					if (vFactorA[i + 2][0] <= intStandardA[i][j]) {
						vFactorA[i + 2][1] = j + 1;
						break;
					}
				}
			}
			// 只有“总分”有“诊断结果”
			String[] strValueA = { "很好", "非常好", "好", "较好", "一般", "较差", "差", "严重", "非常严重" };
			// vAppraise = strValueA(CInt(vFactorA(7, 1)) - 1)
			// 原始代码是CInt，仔细看了下代码，此处的作用就是强制转换，里面的数据本来就是整数，只是定义时作为float而已
			String vAppraise = strValueA[(int) (vFactorA[7][1]) - 1];

			ClsScore.Spdf spdf = new ClsScore.Spdf();

			spdf.setPl_o(vFactorA[0][0]);
			spdf.setPl_s(vFactorA[0][1]);

			spdf.setWjl_o(vFactorA[1][0]);
			spdf.setWjl_s(vFactorA[1][1]);

			spdf.setNxbmz_o(vFactorA[2][0]);
			spdf.setNxbmz_s(vFactorA[2][1]);

			spdf.setNxhb_o(vFactorA[3][0]);
			spdf.setNxhb_s(vFactorA[3][1]);

			spdf.setNxwxg_o(vFactorA[4][0]);
			spdf.setNxwxg_s(vFactorA[4][1]);

			spdf.setYdjl_o(vFactorA[5][0]);
			spdf.setYdjl_s(vFactorA[5][1]);

			spdf.setQfxkl_o(vFactorA[6][0]);
			spdf.setQfxkl_s(vFactorA[6][1]);

			spdf.setTotal_o(vFactorA[7][0]);
			spdf.setTotal_s(vFactorA[7][1]);

			spdf.setTotal_a(vAppraise);

			result.setObject(spdf);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 八十一、生存质量测定量表（Whoqol）共103题
	private static ClsAnswerResult GetWhoqolFactorScore(ClsAnswerRequest answer) {
		// 1生理领域(大)，2疼痛与不适，3精力与疲倦，4睡眠与休息，5心理领域(大)，6积极感受，7思想、学习、记忆和注意力，8自尊，9身材与相貌，10消极感受
		// 11独立性领域(大)，12行动能力，13日常生活能力，14对药物及医疗手段的依赖性，15工作能力，16社会关系领域(大)，17个人关系，18所需社会支持的满意度，19性生活
		// 20环境领域(大)，21社会安全保障，22住房环境，23经济来源，24医疗服务与社会保障，25获取新信息、知识、技能的机会，26休闲娱乐活动的参与机会与参与程度
		// 27环境条件(污染/噪声/交通/气候)，28交通条件，29精神支柱/宗教/个人信仰(大)，30总体健康和生存质量
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 103;

			int intI;
			String strAnswer_c_Temp = answer.getAnswer().replaceAll("@", "0@@");
			String[] strAnswer_c = strAnswer_c_Temp.split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j, k;

			// 求出所有的24个副因子+1个因子，其他5个大因子由副因子计算得出
			// 共二组，第一组：1,2,3,4,5；第二组5,4,3,2,1
			String[][] strNumberA = {
					{ "", "86,1,2,3", "40,56", "83,57", "", "8,87,9,10", "84,58,11,59", "12,13,60,61", "41,62",
							"88,16,17,18", "", "93,96", "42,63", "43,21,22,23", "89,90,92,91", "", "80,64,68",
							"44,45,66,67", "82,25,65", "", "27,28,69", "30,46,70,31", "47,71", "34,85,72,73",
							"48,49,74,75", "50,51,35,76", "36,77,78", "52,77", "97,98,99,100", "81,53,54,55" },
					{ "", "", "4,5", "6,7", "", "", "", "", "14,15", "", "", "94,95", "19,20", "", "", "", "24", "",
							"26", "", "29", "", "32,33", "", "", "", "37", "38,39", "", "" } };
			int[][] intScoreA = { { 1, 2, 3, 4, 5 }, { 5, 4, 3, 2, 1 } };
			String[] strSubA;

			float[][] vFactorA = new float[30][2]; // 实际为30个因子(分“原始分”和“标准分”)
			for (i = 0; i < vFactorA.length; i++) {
				for (j = 0; j < vFactorA[0].length; j++) {
					vFactorA[i][j] = 0;
				}
			}
			// 有1个特殊答案，1-答案，2-第103题(3个字以下)
			// “原始分”
			for (i = 0; i < strNumberA.length; i++) {
				for (j = 0; j < strNumberA[0].length; j++) {
					if (strNumberA[i][j].length() > 0) {
						strSubA = strNumberA[i][j].split(",");
						for (k = 0; k < strSubA.length; k++) {
							vFactorA[j][0] += intScoreA[i][Integer.valueOf(sAnswer[Integer.valueOf(strSubA[k]) - 1])
									- 1];
						}
					}
				}
			}

			/*
			 * BigDecimal bd = new BigDecimal(); vFactorA[i][1] = bd.setScale(2,
			 * BigDecimal.ROUND_HALF_UP).floatValue();
			 */

			// 1生理领域(大) PHYS = Round((24 – Pain + Energy + Sleep) / 3 , 2)
			BigDecimal bd1 = new BigDecimal((24 - vFactorA[1][0] + vFactorA[2][0] + vFactorA[3][0]) / 3);
			vFactorA[0][0] = bd1.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
			// 5心理领域(大) PSYCH = Round((Feel + Think + Esteem + Body + 24 – Neg) / 5 , 2)
			BigDecimal bd2 = new BigDecimal(
					(vFactorA[5][0] + vFactorA[6][0] + vFactorA[7][0] + vFactorA[8][0] + 24 - vFactorA[9][0]) / 5);
			vFactorA[4][0] = bd2.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
			// 11独立性领域(大) IND = Round((Mobil + Active + 24 – Medic + Work) / 4 , 2)
			BigDecimal bd3 = new BigDecimal(
					(vFactorA[11][0] + vFactorA[12][0] + 24 - vFactorA[13][0] + vFactorA[14][0]) / 4);
			vFactorA[10][0] = bd3.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
			// 16社会关系领域(大) SOCIL = Round((Relat + Supp + Sexx) / 3 , 2)
			BigDecimal bd4 = new BigDecimal((vFactorA[16][0] + vFactorA[17][0] + vFactorA[18][0]) / 3);
			vFactorA[15][0] = bd4.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
			// 20环境领域(大) ENVIR = Round((Safety + Home + Finan + Servie + Inform + Leisur +
			// Enviroment + Transp) / 8 , 2)
			BigDecimal bd5 = new BigDecimal((vFactorA[20][0] + vFactorA[21][0] + vFactorA[22][0] + vFactorA[23][0]
					+ vFactorA[24][0] + vFactorA[25][0] + vFactorA[26][0] + vFactorA[27][0]) / 8);
			vFactorA[19][0] = bd5.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
			// 29精神支柱/宗教/个人信仰(大)，不需要再计算

			// “标准分”公式：Standard(i) = Round((Original(i) – 4) * 100 / 16 , 2)
			BigDecimal bd;
			for (i = 0; i < vFactorA.length; i++) {
				bd = new BigDecimal((vFactorA[i][0] - 4) * 100 / 16);
				vFactorA[i][1] = bd.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
			}

			ClsScore.Whoqol whoqol = new ClsScore.Whoqol();

			whoqol.setPhysiology_o(vFactorA[0][0]);
			whoqol.setPhysiology_s(vFactorA[0][1]);

			whoqol.setPain_o(vFactorA[1][0]);
			whoqol.setPain_s(vFactorA[1][1]);

			whoqol.setEnergy_o(vFactorA[2][0]);
			whoqol.setEnergy_s(vFactorA[2][1]);

			whoqol.setSleep_o(vFactorA[3][0]);
			whoqol.setSleep_s(vFactorA[3][1]);

			whoqol.setPsychology_o(vFactorA[4][0]);
			whoqol.setPsychology_s(vFactorA[4][1]);

			whoqol.setFeel_o(vFactorA[5][0]);
			whoqol.setFeel_s(vFactorA[5][1]);

			whoqol.setThink_o(vFactorA[6][0]);
			whoqol.setThink_s(vFactorA[6][1]);

			whoqol.setEsteem_o(vFactorA[7][0]);
			whoqol.setEsteem_s(vFactorA[7][1]);

			whoqol.setBody_o(vFactorA[8][0]);
			whoqol.setBody_s(vFactorA[8][1]);

			whoqol.setNeg_o(vFactorA[9][0]);
			whoqol.setNeg_s(vFactorA[9][1]);

			whoqol.setIndependence_o(vFactorA[10][0]);
			whoqol.setIndependence_s(vFactorA[10][1]);

			whoqol.setMobile_o(vFactorA[11][0]);
			whoqol.setMobile_s(vFactorA[11][1]);

			whoqol.setActive_o(vFactorA[12][0]);
			whoqol.setActive_s(vFactorA[12][1]);

			whoqol.setMedic_o(vFactorA[13][0]);
			whoqol.setMedic_s(vFactorA[13][1]);

			whoqol.setWork_o(vFactorA[14][0]);
			whoqol.setWork_s(vFactorA[14][1]);

			whoqol.setSociety_o(vFactorA[15][0]);
			whoqol.setSociety_s(vFactorA[15][1]);

			whoqol.setRela_o(vFactorA[16][0]);
			whoqol.setRela_s(vFactorA[16][1]);

			whoqol.setSupp_o(vFactorA[17][0]);
			whoqol.setSupp_s(vFactorA[17][1]);

			whoqol.setSex_o(vFactorA[18][0]);
			whoqol.setSex_s(vFactorA[18][1]);

			whoqol.setEnvironment_o(vFactorA[19][0]);
			whoqol.setEnvironment_s(vFactorA[19][1]);

			whoqol.setSafe_o(vFactorA[20][0]);
			whoqol.setSafe_s(vFactorA[20][1]);

			whoqol.setHome_o(vFactorA[21][0]);
			whoqol.setHome_s(vFactorA[21][1]);

			whoqol.setFina_o(vFactorA[22][0]);
			whoqol.setFina_s(vFactorA[22][1]);

			whoqol.setServe_o(vFactorA[23][0]);
			whoqol.setServe_s(vFactorA[23][1]);

			whoqol.setInfo_o(vFactorA[24][0]);
			whoqol.setInfo_s(vFactorA[24][1]);

			whoqol.setLeisure_o(vFactorA[25][0]);
			whoqol.setLeisure_s(vFactorA[25][1]);

			whoqol.setEnvi_o(vFactorA[26][0]);
			whoqol.setEnvi_s(vFactorA[26][1]);

			whoqol.setTraffic_o(vFactorA[27][0]);
			whoqol.setTraffic_s(vFactorA[27][1]);

			whoqol.setSpirit_o(vFactorA[28][0]);
			whoqol.setSpirit_s(vFactorA[28][1]);

			whoqol.setTotal_o(vFactorA[29][0]);
			whoqol.setTotal_s(vFactorA[29][1]);

			result.setObject(whoqol);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 八十二、纽芬兰纪念大学幸福度（Munsh）共24题 ****
	private static ClsAnswerResult GetMunshFactorScore(ClsAnswerRequest answer) {
		// 1正性情感，2负性情感，3一般正性体验，4一般负性体验，5总幸福度
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 24;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共一组，0,1,2
			String[] strNumberA = { "1,2,3,4,10", "5,6,7,8,9", "12,14,15,21,23,24", "11,13,16,17,18,20,22" };
			String[] strSubA;

			int[] vFactorA = new int[5]; // 实际为5个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}
			// 原始分
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactorA[i] += Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]) - 1;
				}
			}
			// 3一般正性体验19(1,1,0)
			if (Integer.valueOf(sAnswer[18]) < 3) {
				vFactorA[2] += 1;
			}
			// 5总幸福度
			vFactorA[4] = vFactorA[0] - vFactorA[1] + vFactorA[2] - vFactorA[3] + 24;

			// 按总分得到“指导意见”
			int[] intValueA = { 14, 34 };
			String vDoctorIdea = "Munsh.1.3";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactorA[4] <= intValueA[i]) {
					vDoctorIdea = "Munsh.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Munsh munsh = new ClsScore.Munsh();

			munsh.setZxqg_o(vFactorA[0]);
			munsh.setFxqg_o(vFactorA[1]);
			munsh.setYbzxty_o(vFactorA[2]);
			munsh.setYbfxty_o(vFactorA[3]);
			munsh.setTotal_o(vFactorA[4]);
			munsh.setTotal_d(vDoctorIdea);

			result.setObject(munsh);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 八十三、(19)Conners简明症状问卷(Connts)共10题
	private static ClsAnswerResult GetConntsFactorScore(ClsAnswerRequest answer) {
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 10;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i = 0;

			// 共1组，0,1,2,3
			int vFactor = 0;
			String vDoctorIdea = "";

			for (i = 0; i < sAnswer.length; i++) {
				vFactor += Integer.valueOf(sAnswer[i]) - 1;
			}

			// 指导意见
			vDoctorIdea = "Connts.1.2";
			if (vFactor < 15) {
				vDoctorIdea = "Connts.1.1";
			}

			ClsScore.Connts connts = new ClsScore.Connts();

			connts.setTotal_o(vFactor);
			connts.setTotal_d(vDoctorIdea);

			result.setObject(connts);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 八十四、(20)Conners教师用量表(Connt)共28题
	private static ClsAnswerResult GetConntFactorScore(ClsAnswerRequest answer) {
		// 1品行问题，2多动问题，3不注意-被动，4-多动指数
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 28;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共一组，0,1,2,3
			String[] strNumberA = { "4,5,6,10,11,12,23,27", "1,2,3,8,14,15,16", "7,9,18,20,21,22,26,28",
					"1,5,7,8,10,11,14,15,21,26" };
			String[] strSubA;

			float[][] vFactorA = new float[4][2]; // 实际为4个因子，只存储“平均分”和“标准分”
			String[] vDoctorIdeaA = new String[4]; // 指导意见

			for (i = 0; i < vFactorA.length; i++) {
				for (j = 0; j < vFactorA[0].length; j++) {
					vFactorA[i][j] = 0;
				}
				vDoctorIdeaA[i] = "";
			}

			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactorA[i][0] += Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]) - 1;
				}
				// 平均分
				BigDecimal bd = new BigDecimal(vFactorA[i][0] / strSubA.length);
				vFactorA[i][0] = bd.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
			}

			float[][] sngMinDiv;
			int intSex = answer.getSex();
			float sngAge = answer.getAge();
			if (intSex == 1) {
				if (sngAge < 6) {
					float[][] arrMinDiv = { { 0.45f, 0.8f }, { 0.79f, 0.89f }, { 0.92f, 1f }, { 0.81f, 0.96f } };
					sngMinDiv = arrMinDiv;
				} else if (6 <= sngAge && sngAge < 9) {
					float[][] arrMinDiv = { { 0.32f, 0.43f }, { 0.6f, 0.65f }, { 0.76f, 0.74f }, { 0.58f, 0.61f } };
					sngMinDiv = arrMinDiv;
				} else if (9 <= sngAge && sngAge < 12) {
					float[][] arrMinDiv = { { 0.5f, 0.66f }, { 0.7f, 0.78f }, { 0.85f, 0.73f }, { 0.67f, 0.65f } };
					sngMinDiv = arrMinDiv;
				} else if (12 <= sngAge && sngAge < 15) {
					float[][] arrMinDiv = { { 0.23f, 0.38f }, { 0.41f, 0.4f }, { 0.71f, 0.63f }, { 0.44f, 0.43f } };
					sngMinDiv = arrMinDiv;
				} else {
					float[][] arrMinDiv = { { 0.22f, 0.37f }, { 0.34f, 0.44f }, { 0.68f, 0.67f }, { 0.41f, 0.45f } };
					sngMinDiv = arrMinDiv;
				}
			} else {
				if (sngAge < 6) {
					float[][] arrMinDiv = { { 0.53f, 0.68f }, { 0.69f, 0.56f }, { 0.72f, 0.71f }, { 0.74f, 0.67f } };
					sngMinDiv = arrMinDiv;
				} else if (6 <= sngAge && sngAge < 9) {
					float[][] arrMinDiv = { { 0.28f, 0.37f }, { 0.28f, 0.38f }, { 0.47f, 0.64f }, { 0.36f, 0.45f } };
					sngMinDiv = arrMinDiv;
				} else if (9 <= sngAge && sngAge < 12) {
					float[][] arrMinDiv = { { 0.28f, 0.49f }, { 0.38f, 0.51f }, { 0.49f, 0.53f }, { 0.38f, 0.48f } };
					sngMinDiv = arrMinDiv;
				} else if (12 <= sngAge && sngAge < 15) {
					float[][] arrMinDiv = { { 0.15f, 0.23f }, { 0.19f, 0.27f }, { 0.32f, 0.42f }, { 0.18f, 0.24f } };
					sngMinDiv = arrMinDiv;
				} else {
					float[][] arrMinDiv = { { 0.33f, 0.68f }, { 0.32f, 0.63f }, { 0.45f, 0.47f }, { 0.36f, 0.62f } };
					sngMinDiv = arrMinDiv;
				}
			}

			for (i = 0; i < sngMinDiv.length; i++) {
				// 标准分，公式：50 + 10 * (Average(i)–arrMinDiv(i,0)) / arrMinDiv (i,1)
				BigDecimal bd1 = new BigDecimal(50 + 10 * (vFactorA[i][0] - sngMinDiv[i][0]) / sngMinDiv[i][1]);
				vFactorA[i][1] = bd1.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();

				// 指导意见
				vDoctorIdeaA[i] = "Connt." + String.valueOf(i + 1) + ".3";
				if (vFactorA[i][0] > sngMinDiv[i][0] + sngMinDiv[i][1]) {
					vDoctorIdeaA[i] = "Connt." + String.valueOf(i + 1) + ".1";
				}
				if (vFactorA[i][0] < sngMinDiv[i][0] + sngMinDiv[i][1]) {
					vDoctorIdeaA[i] = "Connt." + String.valueOf(i + 1) + ".2";
				}
			}

			ClsScore.Connt connt = new ClsScore.Connt();

			connt.setPxwt_ave(vFactorA[0][0]);
			connt.setPxwt_s(vFactorA[0][1]);
			connt.setPxwt_d(vDoctorIdeaA[0]);

			connt.setDdwt_ave(vFactorA[1][0]);
			connt.setDdwt_s(vFactorA[1][1]);
			connt.setDdwt_d(vDoctorIdeaA[1]);

			connt.setBzybd_ave(vFactorA[2][0]);
			connt.setBzybd_s(vFactorA[2][1]);
			connt.setBzybd_d(vDoctorIdeaA[2]);

			connt.setDdzs_ave(vFactorA[3][0]);
			connt.setDdzs_s(vFactorA[3][1]);
			connt.setDdzs_d(vDoctorIdeaA[3]);

			result.setObject(connt);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 八十五、(26)儿童孤独症家长评定量表(Abc)共57题
	private static ClsAnswerResult GetAbcFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 57;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i;

			// 共1组，0,1,2,3,4
			int vFactor = 0;
			String vDoctorIdea = "";

			for (i = 0; i < sAnswer.length; i++) {
				vFactor += Integer.valueOf(sAnswer[i]) - 1;
			}

			// 指导意见
			vDoctorIdea = "Abc.1.3";
			if (vFactor < 53) {
				vDoctorIdea = "Abc.1.1";
			} else if (53 <= vFactor && vFactor <= 67) {
				vDoctorIdea = "Abc.1.2";
			}

			ClsScore.Abc abc = new ClsScore.Abc();

			abc.setTotal_o(vFactor);
			abc.setTotal_d(vDoctorIdea);

			result.setObject(abc);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 八十六、(27)儿童期孤独症评定量表(Cars)共15题
	private static ClsAnswerResult GetCarsFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 15;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i = 0;

			// 共1组，1,2,3,4
			int vFactor = 0;
			String vDoctorIdea = "";

			for (i = 0; i < sAnswer.length; i++) {
				vFactor += Integer.valueOf(sAnswer[i]);
			}

			// 指导意见
			vDoctorIdea = "Cars.1.3";
			if (vFactor < 30) {
				vDoctorIdea = "Cars.1.1";
			} else if (30 <= vFactor && vFactor < 36) {
				vDoctorIdea = "Cars.1.2";
			}

			ClsScore.Cars cars = new ClsScore.Cars();

			cars.setTotal_o(vFactor);
			cars.setTotal_d(vDoctorIdea);

			result.setObject(cars);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 八十七、(30)父母养育方式评价量表(Embu)共66或132题，常模按照父母一起完成，所以132题
	// 转换回原来格式,原来父亲是1-4，母亲是5-8，现在母亲也是1-4，所以计分的时候母亲不需要减去4了
	private static ClsAnswerResult GetEmbuFactorScore(ClsAnswerRequest answer) {
		// 父亲：因子1，因子2，因子3，因子4，因子5，因子6
		// 母亲：因子1，因子2，因子3，因子4，因子5
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 132;

			int intI;
			// 转换回原来格式
			String[] strAnswer_c = answer.getAnswer().replaceAll("&", "|").split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 如是是只有父亲，则X|0|X|0|；如果只有母亲，则0|X|0|X|；父母的答案交替出现
			// 共1组，1,2,3,4
			String[] strNumberFA = { "2,4,6,7,9,15,20,25,29,30,31,32,33,37,42,54,60,61,66",
					"5,13,17,18,43,49,51,52,53,55,58,62", "1,10,11,14,27,36,48,50,56,57", "3,8,22,64,65",
					"21,23,28,34,35,45", "12,16,39,40,59" };
			String[] strNumberMA = { "2,4,6,7,9,15,25,29,30,31,32,33,37,42,44,54,60,61,63",
					"1,11,12,14,16,19,24,27,35,36,41,48,50,56,57,59", "23,26,28,34,38,39,45,47",
					"13,17,43,51,52,53,55,58,62", "3,8,22,64,65" };
			String[] strSubA;

			float[] vFactorA = new float[11]; // 实际为6+5个因子，父亲6，母亲5
			String[] vDoctorIdeaA = new String[11]; // 指导意见

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
				vDoctorIdeaA[i] = ""; // 会有“空”出现
			}
			int vMode = 0;

			// 均分标准差
			float[][] sngMinDivF = { { 51.54f, 8.89f }, { 15.84f, 3.98f }, { 20.92f, 3.66f }, { 9.82f, 3.83f },
					{ 8.27f, 2.4f }, { 12.43f, 3.12f } };
			float[][] sngMinDivM = { { 55.71f, 9.31f }, { 36.42f, 6.02f }, { 11.47f, 3.26f }, { 11.13f, 2.84f },
					{ 9.99f, 3.81f } };

			// 父亲
			if (Integer.valueOf(sAnswer[0]) > 0 && Integer.valueOf(sAnswer[2]) > 0) {
				for (i = 0; i < strNumberFA.length; i++) {
					strSubA = strNumberFA[i].split(",");
					for (j = 0; j < strSubA.length; j++) {
						vFactorA[i] += Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) * 2 - 2]);
					}
					// 指导意见
					vDoctorIdeaA[i] = "Embu." + String.valueOf(i + 1) + ".3";
					if (vFactorA[i] <= sngMinDivF[i][0] - sngMinDivF[i][1]) {
						vDoctorIdeaA[i] = "Embu." + String.valueOf(i + 1) + ".1";
					} else if (vFactorA[i] < sngMinDivF[i][0]) {
						vDoctorIdeaA[i] = "Embu." + String.valueOf(i + 1) + ".2";
					}
				}
				vMode += 1;
			}

			// 母亲
			if (Integer.valueOf(sAnswer[1]) > 0 && Integer.valueOf(sAnswer[3]) > 0) {
				for (i = 0; i < strNumberMA.length; i++) {
					int k = i + 6;
					strSubA = strNumberMA[i].split(",");
					for (j = 0; j < strSubA.length; j++) {
						vFactorA[k] += Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) * 2 - 1]);
					}
					// 指导意见
					vDoctorIdeaA[k] = "Embu." + String.valueOf(k + 1) + ".3";
					if (vFactorA[k] <= sngMinDivM[i][0] - sngMinDivM[i][1]) {
						vDoctorIdeaA[k] = "Embu." + String.valueOf(k + 1) + ".1";
					} else if (vFactorA[k] < sngMinDivM[i][0]) {
						vDoctorIdeaA[k] = "Embu." + String.valueOf(k + 1) + ".2";
					}
				}
				vMode += 2;
			}

			ClsScore.Embu embu = new ClsScore.Embu();

			embu.setFather1_o(vFactorA[0]);
			embu.setFather1_d(vDoctorIdeaA[0]);

			embu.setFather2_o(vFactorA[1]);
			embu.setFather2_d(vDoctorIdeaA[1]);

			embu.setFather3_o(vFactorA[2]);
			embu.setFather3_d(vDoctorIdeaA[2]);

			embu.setFather4_o(vFactorA[3]);
			embu.setFather4_d(vDoctorIdeaA[3]);

			embu.setFather5_o(vFactorA[4]);
			embu.setFather5_d(vDoctorIdeaA[4]);

			embu.setFather6_o(vFactorA[5]);
			embu.setFather6_d(vDoctorIdeaA[5]);

			embu.setMother1_o(vFactorA[6]);
			embu.setMother1_d(vDoctorIdeaA[6]);

			embu.setMother2_o(vFactorA[7]);
			embu.setMother2_d(vDoctorIdeaA[7]);

			embu.setMother3_o(vFactorA[8]);
			embu.setMother3_d(vDoctorIdeaA[8]);

			embu.setMother4_o(vFactorA[9]);
			embu.setMother4_d(vDoctorIdeaA[9]);

			embu.setMother5_o(vFactorA[10]);
			embu.setMother5_d(vDoctorIdeaA[10]);

			embu.setMode(vMode);

			result.setObject(embu);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 八十八、(31)青少年生活事件量表(Aslec)共27题
	private static ClsAnswerResult GetAslecFactorScore(ClsAnswerRequest answer) {
		// 1人际关系因子，2学习压力因子，3受惩罚因子，4丧失因子，5健康适应因子，6其他
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 27;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共1组，1,1,2,3,4,5
			String[] strNumberA = { "1,2,4,15,25", "3,9,16,18,22", "17,18,19,20,21,23,24", "12,13,14", "5,8,11,27",
					"6,7,23,24" };
			int[] intScoreA = { 1, 1, 2, 3, 4, 5 };
			String[] strSubA;

			float[] vFactorA = new float[6]; // 实际为6个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactorA[i] += intScoreA[Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1]) - 1];
				}
			}

			ClsScore.Aslec aslec = new ClsScore.Aslec();

			aslec.setRjgx_o(vFactorA[0]);
			aslec.setXxyl_o(vFactorA[1]);
			aslec.setScf_o(vFactorA[2]);
			aslec.setSs_o(vFactorA[3]);
			aslec.setJksy_o(vFactorA[4]);
			aslec.setOther_o(vFactorA[5]);

			result.setObject(aslec);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 八十九、(46)职业兴趣调查问卷(Zyqx)共23题*5=115题，0个因子，5个选项(不选的为0)，多选题
	private static ClsAnswerResult GetZyqxFactorScore(ClsAnswerRequest answer) {
		// 多选题，每一题为一个类型，有5个选项，每选择一个得1分，总共23个可选择的工作。
		// 1艺术性，2音乐性，3文学性，4娱乐性，5文书销售：技术工作，6文书销售：电脑工作
		// 7记录及一般书记工作，8大众联系工作，9服务业：公共服务，10服务业：烹饪，11幼儿照料，12个人服务
		// 13农业，14渔业，15林业，16工程：科技工作，17机械工作，18电工
		// 19建筑工艺，20艺术工匠，21机械操作，22绘画艺术工作，23加工业
		// 选择出原始分占前四位的工作。分数相同按排列顺序。
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 115;

			int intI;

			String[] strAnswer_Temp = answer.getAnswer().split(g_nChar);
			String[] sAnswer_Temp = new String[115];
			String strAnswer_c_Temp = "";
			int i;
			int j;
			for (i = 0; i < sAnswer_Temp.length; i++) {
				sAnswer_Temp[i] = "0";
			}
			for (i = 0; i < strAnswer_Temp.length; i++) {
				for (j = 0; j < strAnswer_Temp[i].split(",").length; j++) {
					sAnswer_Temp[i * 5 + Integer.valueOf(strAnswer_Temp[i].split(",")[j].toString().trim()) - 1] = "1";
				}
			}

			for (i = 0; i < sAnswer_Temp.length; i++) {
				strAnswer_c_Temp += sAnswer_Temp[i] + "|";
			}
			if (strAnswer_c_Temp.length() > 0) {
				strAnswer_c_Temp = strAnswer_c_Temp.substring(0, strAnswer_c_Temp.length() - 1);
			}

			String[] strAnswer_c = strAnswer_c_Temp.split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

//			int i, j;

			// 共1组，0,1
			String[] vAppraiseA = new String[4]; // 实际为4个“诊断结果”
			for (i = 0; i < vAppraiseA.length; i++) {
				vAppraiseA[i] = "";
			}

			float[] sngScoreA = new float[23];
			// For i = sAnswer.GetLowerBound(0) To sAnswer.GetUpperBound(0) Step 5
			for (i = 0; i < sAnswer.length; i += 5) {
				int intIndex = (int) (i / 5);
				for (j = 0; j < 5; j++) {
					sngScoreA[intIndex] += Integer.valueOf(sAnswer[i + j]);
				}
			}

			// 进行排序，选择出原始分占前四位的工作。分数相同按排列顺序。
			int[] intSortA = new int[sngScoreA.length];
			for (i = 0; i < sngScoreA.length; i++) {
				sngScoreA[i] += (sngScoreA.length - 1 - i) * 0.01;
				intSortA[i] = i;
			}

			// 下面这句是VB源码，功能是第一个数组按照从小到大排序，第二个数组，对应第一个的顺序同时调整位置。
			// Array.Sort(sngScoreA, intSortA) '排序，从小到大
			// 下面是对应上面这句话的功能进行JAVA改写
			Map<Float, Integer> map = new TreeMap<Float, Integer>(new Comparator<Float>() {
				public int compare(Float obj1, Float obj2) {
					// 升序排列
					return obj1.compareTo(obj2);
				}
			});
			for (i = 0; i < sngScoreA.length; i++) {
				map.put(sngScoreA[i], intSortA[i]);
				// System.out.println(sngScoreA[i] + ":" + intSortA[i]);
			}

			Set<Float> keySet = map.keySet();
			Iterator<Float> iter = keySet.iterator();
			i = 0;
			while (iter.hasNext()) {
				Float key = iter.next();
				sngScoreA[i] = key;
				intSortA[i] = map.get(key);
				// System.out.println(sngScoreA[i] + ":" + intSortA[i]);
				i += 1;
				// System.out.println(key + ":" + map.get(key));
			}

			String[] strCareerA = { "艺术型", "音乐型", "文学型", "娱乐型", "文书销售：技术工作", "文书销售：电脑工作", "记录及一般书记工作", "大众联系工作",
					"服务业：公共服务", "服务业：烹饪", "幼儿照料", "个人服务", "农业", "渔业", "林业", "工程：科技工作", "机械工作", "电工", "建筑工艺", "艺术工匠",
					"机械操作", "绘画艺术工作", "加工业" };
			for (i = 0; i < vAppraiseA.length; i++) {
				vAppraiseA[i] = strCareerA[intSortA[intSortA.length - 1 - i]];
			}

			ClsScore.Zyqx zyqx = new ClsScore.Zyqx();

			zyqx.setJob1_a(vAppraiseA[0]);
			zyqx.setJob2_a(vAppraiseA[1]);
			zyqx.setJob3_a(vAppraiseA[2]);
			zyqx.setJob4_a(vAppraiseA[3]);

			result.setObject(zyqx);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 九十、(49)霍兰德职业倾向问卷(Hldzyqx)共48*3题=144题
	private static ClsAnswerResult GetHldzyqxFactorScore(ClsAnswerRequest answer) {
		// 1现实型，2探索型，3艺术型，4社会型，5管理型，6常规型
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 144;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j, k;

			// 特殊部分，在第三组的48题中，43~48为反向计分
			// 共1组，否0,是1
			String[] strNumberA = { "1,7,13,19,25,31,37,43", "2,8,14,20,26,32,38,44", "3,9,15,21,27,33,39,45",
					"4,10,16,22,28,34,40,46", "5,11,17,23,29,35,41,47", "6,12,18,24,30,36,42,48" };
			String[] strSubA;

			float[] vFactorA = new float[6]; // 实际为6个因子
			String[] vDoctorIdeaA = new String[3]; // 指导意见，只需要列出对应的3个内容

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}
			for (i = 0; i < vDoctorIdeaA.length; i++) {
				vDoctorIdeaA[i] = "";
			}

			// 反向计分题
			for (i = 138; i < 144; i++) {
				sAnswer[i] = (sAnswer[i].equals("1") ? "2" : "1");
			}

			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					for (k = 0; k < 3; k++) {
						vFactorA[i] += Integer.valueOf(sAnswer[Integer.valueOf(strSubA[j]) - 1 + 48 * k]) - 1;
					}
				}
			}

			// 按因子从大到小排序，先选择一个第一个文件名，再选择二个第二个文件名。若分值相等，按排列顺序选择。
			float[] sngScoreA = new float[6];
			int[] intSortA = new int[6];
			for (i = 0; i < intSortA.length; i++) {
				sngScoreA[i] = vFactorA[i];
				sngScoreA[i] += (intSortA.length - 1 - i) * 0.01;
				intSortA[i] = i;
			}

			// 下面这句是VB源码，功能是第一个数组按照从小到大排序，第二个数组，对应第一个的顺序同时调整位置。
			// Array.Sort(sngScoreA, intSortA) '排序，从小到大
			// 下面是对应上面这句话的功能进行JAVA改写
			Map<Float, Integer> map = new TreeMap<Float, Integer>(new Comparator<Float>() {
				public int compare(Float obj1, Float obj2) {
					// 升序排列
					return obj1.compareTo(obj2);
				}
			});
			for (i = 0; i < sngScoreA.length; i++) {
				map.put(sngScoreA[i], intSortA[i]);
				// System.out.println(sngScoreA[i] + ":" + intSortA[i]);
			}

			Set<Float> keySet = map.keySet();
			Iterator<Float> iter = keySet.iterator();
			i = 0;
			while (iter.hasNext()) {
				Float key = iter.next();
				sngScoreA[i] = key;
				intSortA[i] = map.get(key);
				// System.out.println(sngScoreA[i] + ":" + intSortA[i]);
				i += 1;
				// System.out.println(key + ":" + map.get(key));
			}

			vDoctorIdeaA[0] = "Hldzyqx.1." + String.valueOf(intSortA[intSortA.length - 1] + 1);
			vDoctorIdeaA[1] = "Hldzyqx.2." + String.valueOf(intSortA[intSortA.length - 1 - 1] + 1);
			vDoctorIdeaA[2] = "Hldzyqx.2." + String.valueOf(intSortA[intSortA.length - 1 - 2] + 1);

			ClsScore.Hldzyqx hldzyqx = new ClsScore.Hldzyqx();

			hldzyqx.setXs_o(vFactorA[0]);
			hldzyqx.setTs_o(vFactorA[1]);
			hldzyqx.setYs_o(vFactorA[2]);
			hldzyqx.setSh_o(vFactorA[3]);
			hldzyqx.setGl_o(vFactorA[4]);
			hldzyqx.setCg_o(vFactorA[5]);

			hldzyqx.setTotal1_d(vDoctorIdeaA[0]);
			hldzyqx.setTotal2_d(vDoctorIdeaA[1]);
			hldzyqx.setTotal3_d(vDoctorIdeaA[2]);

			result.setObject(hldzyqx);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 九十一、(53)多动症诊断量表(Adhd)共18题
	private static ClsAnswerResult GetAdhdFactorScore(ClsAnswerRequest answer) {
		// 1注意力分散，2多动或冲动
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 18;

			int intI;
			// 2,3,5,8|1,9
			String[] strAnswer_Temp = answer.getAnswer().split(g_nChar);
			String[] sAnswer = new String[18];
			int i;
			int j;
			for (i = 0; i < sAnswer.length; i++) {
				sAnswer[i] = "0";
			}
			for (i = 0; i < 2; i++) {
				for (j = 0; j < strAnswer_Temp[i].split(",").length; j++) {
					sAnswer[i * 9 + Integer.valueOf(strAnswer_Temp[i].split(",")[j].toString()) - 1] = "1";
				}
			}

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			// int i = 0;

			// 共1组，0,1
			int[] intNumberA = { 9, 18 };

			float[] vFactorA = new float[2]; // 实际为2个因子

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}
			String vAppraise = "";

			int intIndex = 0;
			for (i = 0; i < sAnswer.length; i++) {
				if (i == intNumberA[intIndex]) {
					intIndex += 1;
				}
				vFactorA[intIndex] += Integer.valueOf(sAnswer[i]);
			}
			// 指导意见
			if (vFactorA[0] >= 6) {
				if (vFactorA[1] >= 6) {
					vAppraise = "ADHD混合型";
				} else {
					vAppraise = "ADHD注意分散为主型";
				}
			} else {
				if (vFactorA[1] >= 6) {
					vAppraise = "ADHD多动型";
				} else {
					vAppraise = "正常类型";
				}
			}

			ClsScore.Adhd adhd = new ClsScore.Adhd();

			adhd.setZyl_o(vFactorA[0]);
			adhd.setDd_o(vFactorA[1]);
			adhd.setTotal_a(vAppraise);

			result.setObject(adhd);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 九十二、睡眠状况自评量表(Srss)共10题
	private static ClsAnswerResult GetSrssFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 10;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i = 0;

			// 共1组，1,2,3,4,5
			float vFactor = 0;

			// 总分
			for (i = 0; i < sAnswer.length; i++) {
				vFactor += Integer.valueOf(sAnswer[i]);
			}

			// 按总分“诊断结果”
			int[] intValueA = { 22, 29, 39 };
			String[] strValueA = { "睡眠状态正常者", "轻度睡眠问题", "中度睡眠问题", "重度睡眠问题" };
			String vAppraise = strValueA[strValueA.length - 1];
			for (i = 0; i < intValueA.length; i++) {
				if (vFactor <= intValueA[i]) {
					vAppraise = strValueA[i];
					break;
				}
			}

			ClsScore.Srss srss = new ClsScore.Srss();

			srss.setTotal_o(vFactor);
			srss.setTotal_a(vAppraise);

			result.setObject(srss);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 九十三、临床疗效总评量表(Cgi)共3题，第3题要选2个
	private static ClsAnswerResult GetCgiFactorScore(ClsAnswerRequest answer) {
		// 1病情严重程度(Sl)，2疗效总评(Gl)，3疗效指数(El)
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 4; // 第3题要选2个

			int intI;
			String[] strAnswer_c = answer.getAnswer().replaceAll("&", "|").split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] sAnswer = strAnswer_c[0].toString().split(g_nChar);

			if (sAnswer.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i = 0;

			// 共两组，第一组0-7，第二组/

			float[] vFactorA = new float[3]; // 实际为3个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			vFactorA[0] = (float) Integer.valueOf(sAnswer[0]) - 1;
			vFactorA[1] = (float) Integer.valueOf(sAnswer[1]) - 1;

			float sng1 = (float) (5 - Integer.valueOf(sAnswer[2]));
			float sng2 = (float) Integer.valueOf(sAnswer[3]);

			// 原始代码
			// vFactorA[2] = Format(sng1 / sng2, "0.00")
			BigDecimal bd = new BigDecimal(sng1 / sng2);
			vFactorA[2] = bd.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();

			ClsScore.Cgi cgi = new ClsScore.Cgi();

			cgi.setSl_o(vFactorA[0]);
			cgi.setGl_o(vFactorA[1]);
			cgi.setEl_o(vFactorA[2]);

			result.setObject(cgi);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 九十四 3-7岁儿童气质问卷(Nyls)，共72题
	private static ClsAnswerResult GetNylsFactorScore(ClsAnswerRequest answer) {
		// 1活动水平，2节律性，3趋避性，4适应性，5反应强度，6情绪本质，7坚持度，8注意分散度，9反应阀
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 72;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j, k;

			// 共2组，第一组1,2,3,4,5,6,7，第二组7,6,5,4,3,2,1
			String[][] strNumberA = { { "1,18,24,45", "34,53,60,64" }, { "6,13,20,55", "31,38,47,70" },
					{ "21,30,42,46", "4,10,62,66" }, { "7,15,33,59", "25,40,51,68" }, { "8,16,43,54", "27,35,61,69" },
					{ "2,14,19,41", "29,50,56,65" }, { "5,28,37,72", "12,22,48,58" }, { "9,17,52,71", "26,36,44,63" },
					{ "11,32,49,62", "3,23,39,57" } };
			String[] strSubA;
			int[][] intScoreA = { { 1, 2, 3, 4, 5, 6, 7 }, { 7, 6, 5, 4, 3, 2, 1 } };

			float[][] vFactorA = new float[9][2]; // 实际为1个因子，平均分，标准分

			for (i = 0; i < vFactorA.length; i++) {
				for (j = 0; j < vFactorA[0].length; j++) {
					vFactorA[i][j] = 0;
				}
			}

			String vAppraise = "";
			String vDoctorIdea = "";

			// 平均分
			for (i = 0; i < strNumberA.length; i++) {
				for (j = 0; j < strNumberA[0].length; j++) {
					strSubA = strNumberA[i][j].split(",");
					for (k = 0; k < strSubA.length; k++) {
						vFactorA[i][0] += intScoreA[j][Integer.valueOf(strChildAnswerA[Integer.valueOf(strSubA[k]) - 1])
								- 1];
					}
				}
				BigDecimal bd = new BigDecimal(vFactorA[i][0] / 8);
				vFactorA[i][0] = bd.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
			}
			// 标准分：Standard(i) = 50+ (Average(i)- arrMinDiv(i,0)) *10 / arrMinDiv(i,1)
			float[][] sngMinDivA;
			int intSex = answer.getSex();
			float sngAge = answer.getAge();
			if (intSex == 1) {
				if (sngAge <= 3) {
					float[][] arrMinDiv = { { 4.03f, 0.86f }, { 4.58f, 0.85f }, { 4.64f, 0.93f }, { 5.05f, 0.78f },
							{ 3.97f, 0.87f }, { 4.58f, 0.63f }, { 3.99f, 0.57f }, { 4.4f, 0.72f }, { 3.26f, 0.85f } };
					sngMinDivA = arrMinDiv;
				} else if (3 < sngAge && sngAge <= 4) {
					float[][] arrMinDiv = { { 3.89f, 0.78f }, { 4.64f, 0.83f }, { 4.84f, 0.82f }, { 5.16f, 0.83f },
							{ 3.9f, 0.84f }, { 4.62f, 0.6f }, { 4.03f, 0.61f }, { 4.37f, 0.71f }, { 3.04f, 0.8f } };
					sngMinDivA = arrMinDiv;
				} else if (4 < sngAge && sngAge <= 5) {
					float[][] arrMinDiv = { { 3.92f, 0.79f }, { 4.49f, 0.82f }, { 5f, 0.86f }, { 5.25f, 0.74f },
							{ 3.73f, 0.81f }, { 4.58f, 0.63f }, { 4.06f, 0.58f }, { 4.35f, 0.73f }, { 3.25f, 0.7f } };
					sngMinDivA = arrMinDiv;
				} else if (5 < sngAge && sngAge <= 6) {
					float[][] arrMinDiv = { { 3.74f, 0.89f }, { 4.53f, 0.84f }, { 5.1f, 0.86f }, { 5.24f, 0.77f },
							{ 3.64f, 0.83f }, { 4.65f, 0.68f }, { 4.15f, 0.59f }, { 4.28f, 0.67f }, { 3.36f, 0.76f } };
					sngMinDivA = arrMinDiv;
				} else {
					float[][] arrMinDiv = { { 3.84f, 0.85f }, { 4.65f, 0.82f }, { 5.06f, 0.83f }, { 5.16f, 0.75f },
							{ 3.57f, 0.75f }, { 4.64f, 0.64f }, { 4.13f, 0.65f }, { 4.23f, 0.78f }, { 3.49f, 0.75f } };
					sngMinDivA = arrMinDiv;
				}
			} else {
				if (sngAge <= 3) {
					float[][] arrMinDiv = { { 3.98f, 0.83f }, { 4.63f, 0.85f }, { 4.8f, 0.89f }, { 5.12f, 0.75f },
							{ 4.04f, 0.85f }, { 4.79f, 0.62f }, { 4.04f, 0.61f }, { 4.5f, 0.75f }, { 3.04f, 0.8f } };
					sngMinDivA = arrMinDiv;
				} else if (3 < sngAge && sngAge <= 4) {
					float[][] arrMinDiv = { { 3.8f, 0.83f }, { 4.48f, 0.91f }, { 4.75f, 0.85f }, { 5.06f, 0.8f },
							{ 3.87f, 0.95f }, { 4.76f, 0.73f }, { 4.08f, 0.62f }, { 4.44f, 0.76f }, { 3.14f, 0.79f } };
					sngMinDivA = arrMinDiv;
				} else if (4 < sngAge && sngAge <= 5) {
					float[][] arrMinDiv = { { 3.6f, 0.89f }, { 4.49f, 0.89f }, { 5f, 0.81f }, { 5.16f, 0.7f },
							{ 3.6f, 0.8f }, { 4.7f, 0.64f }, { 4.08f, 0.61f }, { 4.58f, 0.72f }, { 3.1f, 0.72f } };
					sngMinDivA = arrMinDiv;
				} else if (5 < sngAge && sngAge <= 6) {
					float[][] arrMinDiv = { { 3.51f, 0.91f }, { 4.57f, 0.89f }, { 5.14f, 0.79f }, { 5.26f, 0.8f },
							{ 3.58f, 0.83f }, { 4.84f, 0.6f }, { 4.11f, 0.6f }, { 4.44f, 0.7f }, { 3.27f, 0.74f } };
					sngMinDivA = arrMinDiv;
				} else {
					float[][] arrMinDiv = { { 3.54f, 0.93f }, { 4.52f, 0.86f }, { 5.03f, 0.82f }, { 5.21f, 0.77f },
							{ 3.52f, 0.82f }, { 4.8f, 0.6f }, { 4.12f, 0.57f }, { 4.43f, 0.78f }, { 3.27f, 0.77f } };
					sngMinDivA = arrMinDiv;
				}
			}

			for (i = 0; i < vFactorA.length; i++) {
				BigDecimal bd1 = new BigDecimal(50 + (vFactorA[i][0] - sngMinDivA[i][0]) * 10 / sngMinDivA[i][1]);
				vFactorA[i][1] = bd1.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
			}

			// 按平均分，得到结果
			// 主要以节律性、趋避性、适应性、反应强度、情绪本质为判断依据
			int[] intOneA = { 1, 2, 3, 5 };
			int[] intTwoA = { 1, 2, 3, 4, 5 };
			int[] intCountA = { 0, 0, 0 };

			for (i = 0; i < intOneA.length; i++) // 节律性、趋避性、适应性、情绪本质
			{
				if (vFactorA[intOneA[i]][0] < sngMinDivA[intOneA[i]][0]) // 低于均值
					intCountA[0] += 1;
			}

			for (i = 0; i < intTwoA.length; i++) // 节律性、趋避性、适应性、反应强度、情绪本质
			{
				if (Math.abs(vFactorA[intTwoA[i]][0] - sngMinDivA[intTwoA[i]][0]) > sngMinDivA[intTwoA[i]][1]) // 偏离出一个标准差
				{
					intCountA[1] += 1;
				}
			}

			// 原始代码每个类型都有Return True直接结束运算，所以这里略作改造，定义一个新参数标识，然后最后返回。
			boolean boolFinish = false;

			// 难养型
			// 1.节律必、趋避性、适应性、情绪本质至少三项低于平均值；
			// 2.反应强度高于平均值；
			// 3.五项中至少两项偏离出一个标准差。
			if (boolFinish == false) {
				if (intCountA[0] >= 3 && vFactorA[4][0] > sngMinDivA[4][0] && intCountA[1] >= 2) {
					vAppraise = "难养型";
					vDoctorIdea = "Nyls.1.1";
					boolFinish = true;
				}
			}

			// 易养型
			// 1.如果反应强度高于平均值，则其它四项中最多有一项低于平均值；如果反应强度不高于平均值，则其它四项中最多有两项低于平均值；
			// 2.没有任何一项偏离出一个标准差。
			int intMin = (vFactorA[4][0] > sngMinDivA[4][0] ? 1 : 2);
			if (boolFinish == false) {
				if (intCountA[0] <= intMin && intCountA[1] <= 0) {
					vAppraise = "易养型";
					vDoctorIdea = "Nyls.1.2";
					boolFinish = true;
				}
			}

			// 启动缓慢型
			// 1.五项中至少三项得分低于平均值且趋避性或适应性有一项低于一个标准差；
			// 2.活动量得分不可高于二分之一个标准差；
			// 3.情绪本质得分不可低于一个标准差。
			if (vFactorA[4][0] < sngMinDivA[4][0]) {
				intCountA[0] += 1;
			}
			if (boolFinish == false) {
				if (intCountA[0] >= 3
						&& (vFactorA[2][0] < sngMinDivA[2][0] - sngMinDivA[2][1]
								|| vFactorA[3][0] < sngMinDivA[3][0] - sngMinDivA[3][1])
						&& vFactorA[0][0] <= sngMinDivA[0][0] + sngMinDivA[0][1] / 2
						&& vFactorA[5][0] >= sngMinDivA[5][0] - sngMinDivA[5][1]) {
					vAppraise = "启动缓慢型";
					vDoctorIdea = "Nyls.1.3";
					boolFinish = true;
				}
			}

			if (boolFinish == false) {
				vAppraise = "中间型";
				vDoctorIdea = "Nyls.1.4";
				boolFinish = true;
			}

			ClsScore.Nyls nyls = new ClsScore.Nyls();

			nyls.setHdsp_ave(vFactorA[0][0]);
			nyls.setHdsp_s(vFactorA[0][1]);

			nyls.setJlx_ave(vFactorA[1][0]);
			nyls.setJlx_s(vFactorA[1][1]);

			nyls.setQbx_ave(vFactorA[2][0]);
			nyls.setQbx_s(vFactorA[2][1]);

			nyls.setSyx_ave(vFactorA[3][0]);
			nyls.setSyx_s(vFactorA[3][1]);

			nyls.setFyqd_ave(vFactorA[4][0]);
			nyls.setFyqd_s(vFactorA[4][1]);

			nyls.setQxbz_ave(vFactorA[5][0]);
			nyls.setQxbz_s(vFactorA[5][1]);

			nyls.setJcd_ave(vFactorA[6][0]);
			nyls.setJcd_s(vFactorA[6][1]);

			nyls.setZyfsd_ave(vFactorA[7][0]);
			nyls.setZyfsd_s(vFactorA[7][1]);

			nyls.setFyf_ave(vFactorA[8][0]);
			nyls.setFyf_s(vFactorA[8][1]);

			nyls.setTotal_a(vAppraise);
			nyls.setTotal_d(vDoctorIdea);

			result.setObject(nyls);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 九十五、Rutter儿童行为父母问卷(Rutterp)，共31题，3个因子，3个选项
	private static ClsAnswerResult GetRutterpFactorScore(ClsAnswerRequest answer) {
		// 1总分，2N分，3A分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 31;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共1组，0,1,2
			String[] strNumberA = { "2,7,14,23,31", "11,21,25,26,29" };
			String[] strSubA;

			float[] vFactorA = new float[3]; // 实际为3个因子

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}
			String vDoctorIdea = "";

			// 总分
			for (i = 0; i < strChildAnswerA.length; i++) {
				vFactorA[0] += Integer.valueOf(strChildAnswerA[i]) - 1;
			}

			// N分，A分
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactorA[i + 1] += Integer.valueOf(strChildAnswerA[Integer.valueOf(strSubA[j]) - 1]) - 1;
				}
			}
			// 指导意见
			vDoctorIdea = "Rutterp.1.4";
			if (vFactorA[0] >= 13) {
				if (vFactorA[1] < vFactorA[2]) {
					vDoctorIdea = "Rutterp.1.1";
				} else if (vFactorA[1] > vFactorA[2]) {
					vDoctorIdea = "Rutterp.1.2";
				} else {
					vDoctorIdea = "Rutterp.1.3";
				}
			}

			ClsScore.Rutterp rutterp = new ClsScore.Rutterp();

			rutterp.setTotal_o(vFactorA[0]);
			rutterp.setTotal_d(vDoctorIdea);
			rutterp.setN_o(vFactorA[1]);
			rutterp.setA_o(vFactorA[2]);

			result.setObject(rutterp);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 九十六、Rutter儿童行为教师问卷(Ruttert)，共26题，3个因子，3个选项
	private static ClsAnswerResult GetRuttertFactorScore(ClsAnswerRequest answer) {
		// 1总分，2N分，3A分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 26;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共1组，0,1,2
			String[] strNumberA = { "1,6,14,17,23", "11,21,22,25,26" };
			String[] strSubA;

			float[] vFactorA = new float[3]; // 实际为3个因子

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}
			String vDoctorIdea = "";

			// 总分
			for (i = 0; i < strChildAnswerA.length; i++) {
				vFactorA[0] += Integer.valueOf(strChildAnswerA[i]) - 1;
			}
			// N分，A分
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactorA[i + 1] += Integer.valueOf(strChildAnswerA[Integer.valueOf(strSubA[j]) - 1]) - 1;
				}
			}

			// 指导意见
			vDoctorIdea = "Ruttert.1.4";
			if (vFactorA[0] >= 9) {
				if (vFactorA[1] < vFactorA[2]) {
					vDoctorIdea = "Ruttert.1.1";
				} else if (vFactorA[1] > vFactorA[2]) {
					vDoctorIdea = "Ruttert.1.2";
				} else {
					vDoctorIdea = "Ruttert.1.3";
				}
			}

			ClsScore.Ruttert ruttert = new ClsScore.Ruttert();

			ruttert.setTotal_o(vFactorA[0]);
			ruttert.setTotal_d(vDoctorIdea);
			ruttert.setN_o(vFactorA[1]);
			ruttert.setA_o(vFactorA[2]);

			result.setObject(ruttert);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 九十七、儿童自我意识量表(Piersharris)，共80题，7个因子，2个选项
	private static ClsAnswerResult GetPiersharrisFactorScore(ClsAnswerRequest answer) {
		// 1行为，2智力与学校情况，3躯体外貌与属性，4焦虑，5合群，6幸福与满足，7总分
		// 均分标准差(只需在报告中显示，不参与计算)
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 80;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j, k;

			// 共2组，第1组1,0，第2组0,1
			String[][] strNumberA = { { "12,21,35,80", "13,14,22,25,34,38,45,48,56,59,62,78" },
					{ "5,9,12,16,17,21,27,30,33,42,49,70", "7,26,31,53,66" },
					{ "5,15,29,33,41,49,54,57,60,63,69,73", "8" }, { "4,6,7,8,10,20,28,37,39,40,43,50,74,79", "" },
					{ "49,51,69", "1,3,6,11,40,46,58,65,77" }, { "2,36,39,52,60,67,80", "8,43,50" } };
			String[] strSubA;
			int[][] intScoreA = { { 1, 0 }, { 0, 1 } };

			float[] vFactorA = new float[7]; // 实际为7个因子

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}
			String vDoctorIdea = "";

			for (i = 0; i < strNumberA.length; i++) {
				for (j = 0; j < strNumberA[0].length; j++) {
					if (strNumberA[i][j].length() > 0) {
						strSubA = strNumberA[i][j].split(",");
						for (k = 0; k < strSubA.length; k++) {
							vFactorA[i] += intScoreA[j][Integer
									.valueOf(strChildAnswerA[Integer.valueOf(strSubA[k]) - 1]) - 1];
						}
					}
				}
				// 总分，是以上6个因子相加，并不是全部的题目得分
				vFactorA[6] += vFactorA[i];
			}

			// 指导意见
			vDoctorIdea = "Piersharris.1.3";
			if (vFactorA[6] <= 46) {
				vDoctorIdea = "Piersharris.1.1";
			} else if (46 < vFactorA[6] && vFactorA[6] < 58) {
				vDoctorIdea = "Piersharris.1.2";
			}

			ClsScore.Piersharris piersharris = new ClsScore.Piersharris();

			piersharris.setXw_o(vFactorA[0]);
			piersharris.setZl_o(vFactorA[1]);
			piersharris.setQt_o(vFactorA[2]);
			piersharris.setJl_o(vFactorA[3]);
			piersharris.setHq_o(vFactorA[4]);
			piersharris.setXf_o(vFactorA[5]);
			piersharris.setTotal_o(vFactorA[6]);
			piersharris.setTotal_d(vDoctorIdea);

			result.setObject(piersharris);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 九十八、儿童感觉统合检核表(Etgj)，共64题，9个因子，5个选项
	private static ClsAnswerResult GetEtgjFactorScore(ClsAnswerRequest answer) {
		// 1前庭平衡和大脑双侧分化情况，2脑神经生理抑制困难，3触觉防御，4发育运用障碍，5视觉空间和形态感觉情形
		// 6重力（地心引力、姿势）不安全症，7学习和情绪状态，8对压力挫折敏感、自我形象不良，9感觉统合整体评估
		// 原始分，T分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 64;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共1组，1,2,3,4,5，1-11,12-20,21-34,35-45,46-50,51-60,61-62,63-64,1-64
			int[] intNumberA = { 11, 20, 34, 45, 50, 60, 62, 64 };

			String[] vDoctorIdeaA = new String[9]; // 指导意见
			float[][] vFactorA = new float[9][2]; // 实际为9个因子

			for (i = 0; i < vFactorA.length; i++) {
				for (j = 0; j < vFactorA[0].length; j++) {
					vFactorA[i][j] = 0;
				}
				vDoctorIdeaA[i] = "";
			}

			// 原始分
			j = 0;
			for (i = 0; i < strChildAnswerA.length; i++) {
				if (i == intNumberA[j]) {
					j += 1; // 移到下一个因子
				}
				vFactorA[j][0] += Integer.valueOf(strChildAnswerA[i]);
				vFactorA[8][0] += Integer.valueOf(strChildAnswerA[i]); // 感觉统合整体评估
			}
			// T分（以3个分数为例，原始分、男T分、女T分）
			String[] TscoreA = {
					"11,70,71,12,64,64,13,61,60,14,58,56,15,55,54,16,53,51,17,50,49,18,48,46,19,46,44,20,44,42,21,42,40,22,40,38,23,38,37,24,37,35,25,35,33,26,33,32,27,31,31,28,29,29,29,28,28,30,28,26,31,26,23,32,26,18,33,25,17,34,24,16,35,22,14,38,18,12",
					"9,72,74,10,68,70,11,65,67,12,64,65,13,62,63,14,60,61,15,58,58,16,55,56,17,53,54,18,51,52,19,49,50,20,47,48,21,45,46,22,43,44,23,42,42,24,40,40,25,38,39,26,37,37,27,35,36,28,34,34,29,32,32,30,30,30,31,28,27,32,27,26,33,26,24,34,24,23,35,22,21,36,21,18,38,18,15",
					"14,70,70,15,65,65,16,63,63,17,61,61,18,58,59,19,56,57,20,54,55,21,53,53,22,51,51,23,50,50,24,48,48,25,47,46,26,45,45,27,44,44,28,43,42,29,41,41,30,40,40,31,38,38,32,37,37,33,36,36,34,34,35,35,33,34,36,32,33,37,31,31,38,29,29,39,27,28,40,25,27,41,22,27,42,21,27,43,21,26,44,20,24,47,19,22,51,19,20,52,18,18",
					"11,66,64,12,60,59,13,58,56,14,55,54,15,54,52,16,51,50,17,50,48,18,48,46,19,46,44,20,45,43,21,43,41,22,42,39,23,40,38,24,39,37,25,37,35,26,36,34,27,35,33,28,34,32,29,33,30,30,32,29,31,31,28,32,30,27,33,29,26,34,27,25,35,26,23,36,25,22,37,25,21,38,25,18,39,24,17,40,22,16,43,18,15",
					"5,61,61,6,54,54,7,50,51,8,47,48,9,44,45,10,41,42,11,38,39,12,35,36,13,32,33,14,30,29,15,28,26,16,26,22,17,25,21,18,23,20,19,21,18,20,18,16",
					"10,63,66,11,57,61,12,54,58,13,52,56,14,50,54,15,48,53,16,47,51,17,46,50,18,44,48,19,43,47,20,41,45,21,40,43,22,38,42,23,36,39,24,34,38,25,32,37,26,31,36,27,29,35,28,28,33,29,27,32,31,25,29,32,22,28,33,21,26,34,20,25,36,19,24,40,17,18",
					"2,57,57,3,48,49,4,43,44,5,38,39,6,33,34,7,28,29,8,25,25,9,23,21,10,21,18",
					"2,57,57,3,48,48,4,43,43,5,38,37,6,34,33,7,29,28,8,25,23,9,21,18,10,18,15",
					"62,74,79,66,70,72,68,68,70,69,68,69,70,67,68,71,66,67,73,64,65,74,64,64,75,63,64,76,63,63,77,62,63,78,61,62,79,61,61,80,60,61,81,59,60,82,59,60,83,59,59,84,58,59,85,57,58,86,57,58,87,56,57,88,56,57,89,56,57,90,55,56,91,54,56,92,54,5,93,54,54,94,53,54,95,53,53,96,52,53,97,52,50,98,52,52,99,51,51,100,51,51,101,50,51,102,50,50,103,50,50,104,49,50,105,49,49,106,49,49,107,48,48,108,48,47,109,47,47,110,47,47,111,46,46,112,46,46,113,45,46,114,45,45,115,45,45,116,44,45,117,44,44,118,43,44,119,43,44,120,42,43,121,42,43,122,42,43,123,41,42,124,41,42,125,40,41,126,40,41,127,40,41,128,39,40,129,39,40,130,39,39,131,38,39,133,37,38,135,37,37,137,36,37,138,36,37,140,35,36,142,34,35,145,33,33,149,32,32,156,31,30,162,27,29,176,24,23,190,21,21,192,18,17" };
			String[] strSubA;
			int intSexTemp = answer.getSex();
			int intSex = (intSexTemp == 1 ? 1 : 2);

			for (i = 0; i < TscoreA.length; i++) {
				strSubA = TscoreA[i].split(",");
				vFactorA[i][1] = Integer.valueOf(strSubA[strSubA.length - 1 - 2 + intSex]); // 防止没有值在范围内，2007-06-06
																							// Haowei debug
				for (j = 0; j < strSubA.length; j += 3) // Step 3
				{
					if (vFactorA[i][0] <= Integer.valueOf(strSubA[j])) {
						vFactorA[i][1] = Integer.valueOf(strSubA[j + intSex]);
						break;
					}
				}
				// 指导意见
				vDoctorIdeaA[i] = "Etgj." + String.valueOf(i + 1) + ".3";
				if (vFactorA[i][1] > 40) {
					vDoctorIdeaA[i] = "Etgj." + String.valueOf(i + 1) + ".1";
				} else if (30 < vFactorA[i][1] && vFactorA[i][1] <= 40) {
					vDoctorIdeaA[i] = "Etgj." + String.valueOf(i + 1) + ".2";
				}
			}

			ClsScore.Etgj etgj = new ClsScore.Etgj();

			etgj.setQt_o(vFactorA[0][0]);
			etgj.setQt_t(vFactorA[0][1]);
			etgj.setQt_d(vDoctorIdeaA[0]);

			etgj.setNsj_o(vFactorA[1][0]);
			etgj.setNsj_t(vFactorA[1][1]);
			etgj.setNsj_d(vDoctorIdeaA[1]);

			etgj.setCj_o(vFactorA[2][0]);
			etgj.setCj_t(vFactorA[2][1]);
			etgj.setCj_d(vDoctorIdeaA[2]);

			etgj.setFy_o(vFactorA[3][0]);
			etgj.setFy_t(vFactorA[3][1]);
			etgj.setFy_d(vDoctorIdeaA[3]);

			etgj.setSj_o(vFactorA[4][0]);
			etgj.setSj_t(vFactorA[4][1]);
			etgj.setSj_d(vDoctorIdeaA[4]);

			etgj.setZl_o(vFactorA[5][0]);
			etgj.setZl_t(vFactorA[5][1]);
			etgj.setZl_d(vDoctorIdeaA[5]);

			etgj.setXx_o(vFactorA[6][0]);
			etgj.setXx_t(vFactorA[6][1]);
			etgj.setXx_d(vDoctorIdeaA[6]);

			etgj.setDyl_o(vFactorA[7][0]);
			etgj.setDyl_t(vFactorA[7][1]);
			etgj.setDyl_d(vDoctorIdeaA[7]);

			etgj.setTotal_o(vFactorA[8][0]);
			etgj.setTotal_t(vFactorA[8][1]);
			etgj.setTotal_d(vDoctorIdeaA[8]);

			result.setObject(etgj);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 九十九、儿童社会期望量表(Csd)，共48题，1个因子，2个选项
	private static ClsAnswerResult GetCsdFactorScore(ClsAnswerRequest answer) {
		// 1总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 48;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共2组，第1组1,0，第2组0,1
			String[] strNumberA = { "1,3,5,6,8,9,11,12,14,16,17,20,22,23,24,26,27,28,29,31,33,34,37,40,42,43,45",
					"2,4,7,10,13,15,18,19,21,25,30,32,35,36,38,39,41,44,46,47,48" };
			String[] strSubA;
			int[][] intScoreA = { { 1, 0 }, { 0, 1 } };

			float vFactor = 0;

			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactor += intScoreA[i][Integer.valueOf(strChildAnswerA[Integer.valueOf(strSubA[j]) - 1]) - 1];
				}
			}

			ClsScore.Csd csd = new ClsScore.Csd();

			csd.setTotal_o(vFactor);

			result.setObject(csd);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百、儿童社交焦虑量表(Sasc)，共10题，1个因子，3个选项
	private static ClsAnswerResult GetSascFactorScore(ClsAnswerRequest answer) {
		// 1总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 10;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i;

			// 共1组，0,1,2

			float vFactor = 0;
			String vDoctorIdea = "";

			for (i = 0; i < strChildAnswerA.length; i++) {
				vFactor += Integer.valueOf(strChildAnswerA[i]) - 1;
			}
			// 指导意见
			float[][] sngScore = { { 8.3f, 9.1f }, { 9.8f, 10.7f } };
			// Dim intSex As Integer = IIf(strSex = "男", 0, 1)
			int intSex = (answer.getSex() == 1 ? 0 : 1);

			vDoctorIdea = "Sasc.1.3";
			if (vFactor < sngScore[intSex][0]) {
				vDoctorIdea = "Sasc.1.1";
			} else if (sngScore[intSex][0] <= vFactor && vFactor <= sngScore[intSex][1]) {
				vDoctorIdea = "Sasc.1.2";
			}

			ClsScore.Sasc sasc = new ClsScore.Sasc();

			sasc.setTotal_o(vFactor);
			sasc.setTotal_d(vDoctorIdea);

			result.setObject(sasc);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百零一、抑郁状态问卷(Dis)，共20题，1个因子，4个选项
	private static ClsAnswerResult GetDisFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 20;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;
			// 共2组，第一组1,2,3,4，第二组4,3,2,1
			String[] strNumberA = { "1,2,4,6,8,9,10,11,12,14,17,20", "3,5,7,13,15,16,18,19" };
			String[] strSubA;
			int[][] intScoreA = { { 1, 2, 3, 4 }, { 4, 3, 2, 1 } };

			float vFactor = 0; // 实际为1个因子
			String vAppraise = "";
			String vDoctorIdea = "";

			// 总分
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactor += intScoreA[i][Integer.valueOf(strChildAnswerA[Integer.valueOf(strSubA[j]) - 1]) - 1];
				}
			}
			// 按总分“诊断结果”和“医生意见”
			int[] intValueA = { 39, 47, 55 };
			String[] strValueA = { "无", "有（轻度）", "有（中度）", "有（重度）" };
			vAppraise = strValueA[strValueA.length - 1] + "抑郁症状";
			vDoctorIdea = "Dis.1.4";
			for (i = 0; i < intValueA.length; i++) {
				if (vFactor <= intValueA[i]) {
					vAppraise = strValueA[i] + "抑郁症状";
					vDoctorIdea = "Dis.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Dis dis = new ClsScore.Dis();

			dis.setTotal_o(vFactor);
			dis.setTotal_a(vAppraise);
			dis.setTotal_d(vDoctorIdea);

			result.setObject(dis);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百零二、自杀态度问卷(Qsa)，共29题，5个因子，5个选项
	private static ClsAnswerResult GetQsaFactorScore(ClsAnswerRequest answer) {
		// 1对自杀行为性质的认识，2对自杀者的态度，3对自杀者家属的态度，4对安乐死的态度，5总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 29;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j, k;

			// 共2组，第一组1,2,3,4,5，第二组5,4,3,2,1
			// “总分”为所有因子相加
			String[][] strNumberA = { { "17,19,23,26,29", "1,7,12,22" }, { "2,9,13,24", "3,8,14,18,20,25" },
					{ "4,6,28", "10,15" }, { "5,16,21,27", "11" } };
			int[] intDivA = { 9, 10, 5, 5 };
			String[] strSubA;
			int[][] intScoreA = { { 1, 2, 3, 4, 5 }, { 5, 4, 3, 2, 1 } };

			float[][] vFactorA = new float[5][2]; // 实际为5个因子，原始分，平均分
			String[] vAppraiseA = new String[4]; // “总分”没有诊断结果

			for (i = 0; i < vFactorA.length; i++) {
				for (j = 0; j < vFactorA[0].length; j++) {
					vFactorA[i][j] = 0;
				}
			}
			for (i = 0; 9 < vAppraiseA.length; i++) {
				vAppraiseA[i] = "";
			}

			// 原始分，平均分
			for (i = 0; i < strNumberA.length; i++) {
				for (j = 0; j < strNumberA[0].length; j++) {
					strSubA = strNumberA[i][j].split(",");
					for (k = 0; k < strSubA.length; k++) {
						vFactorA[i][0] += intScoreA[j][Integer.valueOf(strChildAnswerA[Integer.valueOf(strSubA[k]) - 1])
								- 1];
					}
				}
				vFactorA[4][0] += vFactorA[i][0];
				BigDecimal bd = new BigDecimal(vFactorA[i][0] / intDivA[i]);
				vFactorA[i][1] = bd.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
			}
			BigDecimal bd1 = new BigDecimal(vFactorA[4][0] / 29);
			vFactorA[4][1] = bd1.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();

			// 按“平均分”得到“诊断结果”
			float[] sngValueA = { 2.5f, 3.49f };
			String[] strPrefixA = { "自杀行为", "自杀者", "自杀者家属", "安乐死" };
			String[] strSuffixA = { "持肯定、认可、理解和宽容的态度。", "持矛盾或中立态度。", "持反对、否定、排斥和歧视态度。" };

			for (i = 0; i < vAppraiseA.length; i++) {
				vAppraiseA[i] = "对" + strPrefixA[i] + strSuffixA[strSuffixA.length - 1];
				for (j = 0; j < sngValueA.length; j++) {
					if (vFactorA[i][1] <= sngValueA[j]) {
						vAppraiseA[i] = "对" + strPrefixA[i] + strSuffixA[j];
						break;
					}
				}
			}

			ClsScore.Qsa qsa = new ClsScore.Qsa();

			qsa.setXw_o(vFactorA[0][0]);
			qsa.setXw_ave(vFactorA[0][1]);
			qsa.setXw_a(vAppraiseA[0]);

			qsa.setZsz_o(vFactorA[1][0]);
			qsa.setZsz_ave(vFactorA[1][1]);
			qsa.setZsz_a(vAppraiseA[1]);

			qsa.setJs_o(vFactorA[2][0]);
			qsa.setJs_ave(vFactorA[2][1]);
			qsa.setJs_a(vAppraiseA[2]);

			qsa.setAls_o(vFactorA[3][0]);
			qsa.setAls_ave(vFactorA[3][1]);
			qsa.setAls_a(vAppraiseA[3]);

			qsa.setTotal_o(vFactorA[4][0]);
			qsa.setTotal_ave(vFactorA[4][1]);

			result.setObject(qsa);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百零三、学龄前儿童活动调查表(Psai)，共24题，1个因子，5个选项
	private static ClsAnswerResult GetPsaiFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 24;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共1组，1,2,3,4,5
			String[] strNumberA = { "1,3,5,6,1,12,14,17,19,20,21", "2,4,7,8,9,10,16,18,22,23,24" };
			String[] strSubA;

			float vFactor = 0;
			String vDoctorIdea = "";

			int[] intScoreA = new int[2]; // “M分”和“W分”
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					intScoreA[i] += Integer.valueOf(strChildAnswerA[Integer.valueOf(strSubA[j]) - 1]);
				}
			}

			// 总分：（M分-W分）* 1.1 + 48.25
			vFactor = (float) ((intScoreA[0] - intScoreA[1]) * 1.1 + 48.25);

			// 指导意见
			float[][] sngNumA = { { 52.26f, 61.66f }, { 29.06f, 38.72f } };
			// Dim intSex As Integer = IIf(strSex = "男", 0, 1)
			int intSex = (answer.getSex() == 1 ? 0 : 1);
			if (vFactor <= sngNumA[intSex][0]) {
				vDoctorIdea = "Psai." + String.valueOf(intSex + 1) + ".1";
			} else if (sngNumA[intSex][0] < vFactor && vFactor < sngNumA[intSex][1]) {
				vDoctorIdea = "Psai." + String.valueOf(intSex + 1) + ".2";
			} else {
				vDoctorIdea = "Psai." + String.valueOf(intSex + 1) + ".3";
			}

			ClsScore.Psai psai = new ClsScore.Psai();

			psai.setTotal_o(vFactor);
			psai.setTotal_d(vDoctorIdea);

			result.setObject(psai);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百零四、4-8个月婴儿气质问卷(Cts48m)，共95题，9个因子，6个选项
	private static ClsAnswerResult GetCts48mFactorScore(ClsAnswerRequest answer) {
		// 1活动水平，2节律性，3趋避性，4适应性，5反应强度，6心境，7持久度，8注意分散，9反应阀
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 95;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j, k;

			// 共2组，第一组1,2,3,4,5,6，第二组6,5,4,3,2,1
			String[][] strNumberA = { { "17,33,43,51,64,71,95", "4,12,30,55,79,86" },
					{ "20,35,46,67,77", "1,13,28,50,60,73,85" }, { "14,31,36,66,74,91", "5,24,45,62,82" },
					{ "19,34,65,78,90", "6,9,29,49,56,94" }, { "18,38,42,54,70", "10,26,75,84,89" },
					{ "2,48,76,93", "23,27,39,61,63,81" }, { "3,25,88", "8,16,32,41,58" },
					{ "15,40,68", "7,21,44,53,59,80,87" }, { "11,37,52,57,69,83", "22,47,72,92" } };
			String[] strSubA;
			int[] intDivA = { 13, 12, 11, 11, 10, 10, 8, 10, 10 };
			int[][] intScoreA = { { 1, 2, 3, 4, 5, 6 }, { 6, 5, 4, 3, 2, 1 } };

			float[] vFactorA = new float[9]; // 实际为1个因子，平均分
			String[] vDoctorIdeaA = new String[10]; // 多一个总评

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
				vDoctorIdeaA[i] = "";
			}
			vDoctorIdeaA[9] = "";

			// 平均分
			for (i = 0; i < strNumberA.length; i++) {
				for (j = 0; j < strNumberA[0].length; j++) {
					strSubA = strNumberA[i][j].split(",");
					for (k = 0; k < strSubA.length; k++) {
						vFactorA[i] += intScoreA[j][Integer.valueOf(strChildAnswerA[Integer.valueOf(strSubA[k]) - 1])
								- 1];
					}
				}
				BigDecimal bd = new BigDecimal(vFactorA[i] / intDivA[i]);
				vFactorA[i] = bd.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
			}

			// 按平均分，得到结果
			float[][] sngMinDivA = { { 3.69f, 0.62f }, { 3.09f, 0.7f }, { 2.91f, 0.81f }, { 2.94f, 0.69f },
					{ 3.59f, 0.66f }, { 3.37f, 0.7f }, { 3.21f, 0.78f }, { 2.91f, 0.66f }, { 3.88f, 0.68f } };
			for (i = 0; i < vFactorA.length; i++) {
				if (vFactorA[i] > sngMinDivA[i][0] + sngMinDivA[i][1] * 2) {
					vDoctorIdeaA[9] = "Cts48m." + String.valueOf(i + 1) + ".1";
				} else if (sngMinDivA[i][0] - sngMinDivA[i][1] * 2 <= vFactorA[i]
						&& vFactorA[i] <= sngMinDivA[i][0] + sngMinDivA[i][1] * 2) {
					vDoctorIdeaA[9] = "Cts48m." + String.valueOf(i + 1) + ".2";
				} else {
					vDoctorIdeaA[9] = "Cts48m." + String.valueOf(i + 1) + ".3";
				}
				// 原版代码
				/*
				 * Select Case vFactorA(i) Case Is > sngMinDivA(i, 0) + sngMinDivA(i, 1) * 2
				 * vDoctorIdeaA(9) = "Cts48m." & (i + 1).ToString & ".1" Case Is >=
				 * sngMinDivA(i, 0) - sngMinDivA(i, 1) * 2 vDoctorIdeaA(9) = "Cts48m." & (i +
				 * 1).ToString & ".2" Case Else vDoctorIdeaA(9) = "Cts48m." & (i + 1).ToString &
				 * ".3" End Select
				 */
			}

			// 主要以节律性、趋避性、适应性、反应强度、心境为判断依据
			int[] intOneA = { 1, 2, 3, 4, 5 };
			int[] intCountA = { 0, 0, 0, 0, 0, 0 };

			// 要计算因子的平均分与标准X及SD的差距（内容有9个，但只统计因子2-6，计算对应的个数）
			for (i = 0; i < intOneA.length; i++) {
				if (vFactorA[i] < sngMinDivA[i][0] - sngMinDivA[i][1] * 2) {
					intCountA[0] += 1;
				} else if (sngMinDivA[i][0] - sngMinDivA[i][1] * 2 <= vFactorA[i]
						&& vFactorA[i] < sngMinDivA[i][0] - sngMinDivA[i][1]) {
					intCountA[1] += 1;
				} else if (sngMinDivA[i][0] - sngMinDivA[i][1] <= vFactorA[i] && vFactorA[i] < sngMinDivA[i][0]) {
					intCountA[2] += 1;
				} else if (sngMinDivA[i][0] <= vFactorA[i] && vFactorA[i] < sngMinDivA[i][0] + sngMinDivA[i][1]) {
					intCountA[3] += 1;
				} else if (sngMinDivA[i][0] + sngMinDivA[i][1] <= vFactorA[i]
						&& vFactorA[i] < sngMinDivA[i][0] + sngMinDivA[i][1] * 2) {
					intCountA[4] += 1;
				} else {
					intCountA[5] += 1;
				}
				/*
				 * Select Case vFactorA(i) Case Is < sngMinDivA(i, 0) - sngMinDivA(i, 1) * 2
				 * intCountA(0) += 1 Case Is < sngMinDivA(i, 0) - sngMinDivA(i, 1) intCountA(1)
				 * += 1 Case Is < sngMinDivA(i, 0) intCountA(2) += 1 Case Is < sngMinDivA(i, 0)
				 * + sngMinDivA(i, 1) intCountA(3) += 1 Case Is < sngMinDivA(i, 0) +
				 * sngMinDivA(i, 1) * 2 intCountA(4) += 1 Case Else '>=X+2SD intCountA(5) += 1
				 * End Select
				 */
			}

			// 原始代码每个类型都有Return True直接结束运算，所以这里略作改造，定义一个新参数标识，然后最后返回。
			boolean boolFinish = false;
			String vAppraise = "";

			// 难养型：（同时符合条件1和2）
			// 条件1：6 <= (Num4 + Num5 * 2 + Num6 * 3) <= 15
			// 条件2：反应强度 >= X And (Num5 + Num6) >= 2 And Num1 = 0 And Num2 = 0 And Num3 <= 1
			int intSum = intCountA[3] + intCountA[4] * 2 + intCountA[5] * 3;
			if (boolFinish == false) {
				if (intSum >= 6 && intSum <= 15 && intCountA[0] == 0 && intCountA[1] == 0 && intCountA[2] <= 1) {
					vAppraise = "难养型";
					vDoctorIdeaA[9] = "Cts48m.10.1";
					boolFinish = true;
				}
			}

			// 易养型:
			// 条件：(Num4 + Num5 * 2 + Num6 * 3) <= 2 And Num5 = 0 And Num6 = 0 Then
			if (boolFinish == false) {
				if (intSum <= 2 && intCountA[4] == 0 && intCountA[5] == 0) {
					vAppraise = "易养型";
					vDoctorIdeaA[9] = "Cts48m.10.2";
					boolFinish = true;
				}
			}

			// 发动缓慢型：（同时符合条件1、2、3，条件1、2、4，条件1、5）
			// 条件1：2 <= (Num4 + Num5 * 2 + Num6 * 3) <= 12
			// 条件2：活动水平 <= X+1/2SD And 反应强度 < X And 心境 >= X-1/2SD
			// 条件3：(X+1/2SD <= 心境 < X Or 心境 >= X+SD) And 趋避性 >= X+SD And 适应性 >= X+SD
			// 条件4：X => 心境 > X+SD And 趋避性 > X+SD And 适应性 > X+SD
			// 条件5：活动水平 < X And X <= 节律性 < X+SD And 趋避性 >= X+SD And 心境 >= X+SD And 反应强度 < X
			if (boolFinish == false) {
				if (intSum >= 2 && intSum <= 15) // 条件1
				{
					float[] Xsd = new float[sngMinDivA.length]; // X+SD
					for (i = 0; i < Xsd.length; i++) {
						Xsd[i] = sngMinDivA[i][0] + sngMinDivA[i][1];
					}

					boolean bl = false;
					if (vFactorA[0] <= sngMinDivA[0][0] + sngMinDivA[0][1] / 2 && vFactorA[4] < sngMinDivA[4][0]
							&& vFactorA[5] > sngMinDivA[5][0] - sngMinDivA[5][1] / 2) // 条件2
					{
						if ((vFactorA[5] > sngMinDivA[5][0] && vFactorA[5] <= sngMinDivA[5][0] + sngMinDivA[5][1] / 2
								|| vFactorA[5] >= Xsd[5]) && vFactorA[2] >= Xsd[2] && vFactorA[3] >= Xsd[3]) // 条件3
						{
							bl = true;
						}
						if (vFactorA[5] >= sngMinDivA[5][0] && vFactorA[5] < Xsd[5] && vFactorA[2] > Xsd[2]
								&& vFactorA[3] > Xsd[3]) // 条件4
						{
							bl = true;
						}
					}
					if (vFactorA[0] < sngMinDivA[0][0] && vFactorA[1] >= sngMinDivA[1][0] && vFactorA[1] < Xsd[1]
							&& vFactorA[2] >= Xsd[2] && vFactorA[5] > Xsd[5] && vFactorA[4] < sngMinDivA[4][0]) // 条件5
					{
						bl = true;
					}
					if (bl == true) {
						vAppraise = "启动缓慢型";
						vDoctorIdeaA[9] = "Cts48m.10.3";
						boolFinish = true;
					}
				}
			}

			if (boolFinish == false) {
				vAppraise = "中间型";
				vDoctorIdeaA[9] = "Cts48m.10.4";
				boolFinish = true;
			}

			ClsScore.Cts48m cts48m = new ClsScore.Cts48m();

			cts48m.setHdsp_ave(vFactorA[0]);
			cts48m.setHdsp_d(vDoctorIdeaA[0]);

			cts48m.setJlx_ave(vFactorA[1]);
			cts48m.setJlx_d(vDoctorIdeaA[1]);

			cts48m.setQbx_ave(vFactorA[2]);
			cts48m.setQbx_d(vDoctorIdeaA[2]);

			cts48m.setSyx_ave(vFactorA[3]);
			cts48m.setSyx_d(vDoctorIdeaA[3]);

			cts48m.setFyqd_ave(vFactorA[4]);
			cts48m.setFyqd_d(vDoctorIdeaA[4]);

			cts48m.setXg_ave(vFactorA[5]);
			cts48m.setXg_d(vDoctorIdeaA[5]);

			cts48m.setCjd_ave(vFactorA[6]);
			cts48m.setCjd_d(vDoctorIdeaA[6]);

			cts48m.setZyfs_ave(vFactorA[7]);
			cts48m.setZyfs_d(vDoctorIdeaA[7]);

			cts48m.setFyf_ave(vFactorA[8]);
			cts48m.setFyf_d(vDoctorIdeaA[8]);

			cts48m.setTotal_a(vAppraise);
			cts48m.setTotal_d(vDoctorIdeaA[9]);

			result.setObject(cts48m);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百零五、1-3岁婴幼儿气质问卷(Cts13y)，共97题，9个因子，6个选项
	private static ClsAnswerResult GetCts13yFactorScore(ClsAnswerRequest answer) {
		// 1活动水平，2节律性，3趋避性，4适应性，5反应强度，6心境，7持久度，8注意分散，9反应阀
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 97;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j, k;

			// 共2组，第一组1,2,3,4,5,6，第二组6,5,4,3,2,1
			String[][] strNumberA = { { "2,24,36,47,52,58", "12,18,64,73,85,90" },
					{ "7,17,33,42,54,68", "1,30,59,77,82" }, { "9,53,87,94", "5,21,26,38,45,57,76,96" },
					{ "44,78,88,93", "11,32,56,60,65" }, { "14,19,29,35,46,74,83", "3,55,70" },
					{ "8,20,25,49,69,84,89,95", "4,31,43,63,75" }, { "6,34,40,51,86", "15,28,62,71,79,91" },
					{ "22,27,61,72,81,97", "13,37,41,50,66" }, { "10,48", "16,23,39,67,80,92" } };
			String[] strSubA;
			int[] intDivA = { 12, 11, 10, 9, 10, 13, 11, 11, 8 };
			int[][] intScoreA = { { 1, 2, 3, 4, 5, 6 }, { 6, 5, 4, 3, 2, 1 } };

			float[] vFactorA = new float[9]; // 实际为1个因子，平均分
			String[] vDoctorIdeaA = new String[10]; // 多一个总评

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
				vDoctorIdeaA[i] = "";
			}

			vDoctorIdeaA[9] = "";

			// 平均分
			for (i = 0; i < strNumberA.length; i++) {
				for (j = 0; j < strNumberA[0].length; j++) {
					strSubA = strNumberA[i][j].split(",");
					for (k = 0; k < strSubA.length; k++) {
						vFactorA[i] += intScoreA[j][Integer.valueOf(strChildAnswerA[Integer.valueOf(strSubA[k]) - 1])
								- 1];
					}
				}
				BigDecimal bd = new BigDecimal(vFactorA[i] / intDivA[i]);
				vFactorA[i] = bd.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
			}

			// 均分标准差
			float[][] sngMinDivA;
			int intSex = answer.getSex();
			if (intSex == 1) {
				float[][] arrMinDivA = { { 3.7f, 0.58f }, { 2.99f, 0.59f }, { 3.26f, 0.81f }, { 3.39f, 0.59f },
						{ 3.94f, 0.68f }, { 3.09f, 0.6f }, { 3.16f, 0.73f }, { 3.73f, 0.59f }, { 3.35f, 0.64f } };
				sngMinDivA = arrMinDivA;
			} else {
				float[][] arrMinDivA = { { 3.62f, 0.6f }, { 2.96f, 0.6f }, { 3.38f, 0.81f }, { 3.31f, 0.59f },
						{ 3.89f, 0.66f }, { 3.06f, 0.57f }, { 3.18f, 0.68f }, { 3.81f, 0.57f }, { 3.31f, 0.64f } };
				sngMinDivA = arrMinDivA;
			}

			// 按平均分，得到“医生意见”
			for (i = 0; i < vFactorA.length; i++) {
				if (vFactorA[i] > sngMinDivA[i][0] + sngMinDivA[i][1] * 2) {
					vDoctorIdeaA[9] = "Cts13y." + String.valueOf(i + 1) + ".1";
				} else if (vFactorA[i] >= sngMinDivA[i][0] - sngMinDivA[i][1] * 2
						&& vFactorA[i] <= sngMinDivA[i][0] + sngMinDivA[i][1] * 2) {
					vDoctorIdeaA[9] = "Cts13y." + String.valueOf(i + 1) + ".2";
				} else {
					vDoctorIdeaA[9] = "Cts13y." + String.valueOf(i + 1) + ".3";
				}

			}

			// 主要以节律性、趋避性、适应性、反应强度、心境为判断依据
			int[] intOneA = { 1, 2, 3, 4, 5 };
			int[] intCountA = { 0, 0, 0, 0, 0, 0 };

			// 要计算因子的平均分与标准X及SD的差距（内容有9个，但只统计因子2-6，计算对应的个数）
			for (i = 0; i < intOneA.length; i++) {
				if (vFactorA[i] < sngMinDivA[i][0] - sngMinDivA[i][1] * 2) {
					intCountA[0] += 1;
				} else if (sngMinDivA[i][0] - sngMinDivA[i][1] * 2 <= vFactorA[i]
						&& vFactorA[i] < sngMinDivA[i][0] - sngMinDivA[i][1]) {
					intCountA[1] += 1;
				} else if (sngMinDivA[i][0] - sngMinDivA[i][1] <= vFactorA[i] && vFactorA[i] < sngMinDivA[i][0]) {
					intCountA[2] += 1;
				} else if (sngMinDivA[i][0] <= vFactorA[i] && vFactorA[i] < sngMinDivA[i][0] + sngMinDivA[i][1]) {
					intCountA[3] += 1;
				} else if (sngMinDivA[i][0] + sngMinDivA[i][1] <= vFactorA[i]
						&& vFactorA[i] < sngMinDivA[i][0] + sngMinDivA[i][1] * 2) {
					intCountA[4] += 1;
				} else {
					intCountA[5] += 1;
				}
			}

			// 原始代码每个类型都有Return True直接结束运算，所以这里略作改造，定义一个新参数标识，然后最后返回。
			boolean boolFinish = false;
			String vAppraise = "";

			// 难养型：（同时符合条件1和2）
			// 条件1：6 <= (Num4 + Num5 * 2 + Num6 * 3) <= 15
			// 条件2：反应强度 >= X And (Num5 + Num6) >= 2 And Num1 = 0 And Num2 = 0 And Num3 <= 1
			int intSum = intCountA[3] + intCountA[4] * 2 + intCountA[5] * 3;
			if (boolFinish == false) {
				if (intSum >= 6 && intSum <= 15 && intCountA[0] == 0 && intCountA[1] == 0 && intCountA[2] <= 1) {
					vAppraise = "难养型";
					vDoctorIdeaA[9] = "Cts13y.10.1";
					boolFinish = true;
				}
			}

			// 易养型:
			// 条件：(Num4 + Num5 * 2 + Num6 * 3) <= 2 And Num5 = 0 And Num6 = 0 Then
			if (boolFinish == false) {
				if (intSum <= 2 && intCountA[4] == 0 && intCountA[5] == 0) {
					vAppraise = "易养型";
					vDoctorIdeaA[9] = "Cts13y.10.2";
					boolFinish = true;
				}
			}

			// 发动缓慢型：（同时符合条件1、2、3，条件1、2、4，条件1、5）
			// 条件1：2 <= (Num4 + Num5 * 2 + Num6 * 3) <= 12
			// 条件2：活动水平 <= X+1/2SD And 反应强度 < X And 心境 >= X-1/2SD
			// 条件3：(X+1/2SD <= 心境 < X Or 心境 >= X+SD) And 趋避性 >= X+SD And 适应性 >= X+SD
			// 条件4：X <= 心境 < X+SD And 趋避性 >= X And 适应性 >= X
			// 条件5：活动水平 < X And X <= 节律性 < X+SD And X <= 趋避性 < X+SD And X <= 适应性 < X+SD And
			// X <= 心境 < X+SD And 反应强度 < X
			if (boolFinish == false) {
				if (intSum >= 2 && intSum <= 15) // 条件1
				{
					float[] Xsd = new float[sngMinDivA.length]; // X+SD
					for (i = 0; i < Xsd.length; i++) {
						Xsd[i] = sngMinDivA[i][0] + sngMinDivA[i][1];
					}

					boolean bl = false;
					if (vFactorA[0] <= sngMinDivA[0][0] + sngMinDivA[0][1] / 2 && vFactorA[4] < sngMinDivA[4][0]
							&& vFactorA[5] > sngMinDivA[5][0] - sngMinDivA[5][1] / 2) // 条件2
					{
						if ((vFactorA[5] > sngMinDivA[5][0] && vFactorA[5] <= sngMinDivA[5][0] + sngMinDivA[5][1] / 2
								|| vFactorA[5] >= Xsd[5]) && vFactorA[2] >= Xsd[2] && vFactorA[3] >= Xsd[3]) // 条件3
						{
							bl = true;
						}
						if (vFactorA[5] >= sngMinDivA[5][0] && vFactorA[5] < Xsd[5] && vFactorA[2] >= sngMinDivA[2][0]
								&& vFactorA[3] >= sngMinDivA[3][0]) // 条件4
						{
							bl = true;
						}
					}

					if (vFactorA[0] < sngMinDivA[0][0] && vFactorA[1] >= sngMinDivA[1][0] && vFactorA[1] < Xsd[1]
							&& vFactorA[2] >= sngMinDivA[2][0] && vFactorA[2] < Xsd[2]
							&& vFactorA[3] >= sngMinDivA[3][0] && vFactorA[3] < Xsd[3]
							&& vFactorA[5] >= sngMinDivA[5][0] && vFactorA[5] < Xsd[5]
							&& vFactorA[4] < sngMinDivA[4][0]) // 条件5
					{
						bl = true;
					}

					if (bl == true) {
						vAppraise = "启动缓慢型";
						vDoctorIdeaA[9] = "Cts13y.10.3";
						boolFinish = true;
					}
				}
			}

			if (boolFinish == false) {
				vAppraise = "中间型";
				vDoctorIdeaA[9] = "Cts13y.10.4";
				boolFinish = true;
			}

			ClsScore.Cts13y cts13y = new ClsScore.Cts13y();

			cts13y.setHdsp_ave(vFactorA[0]);
			cts13y.setHdsp_d(vDoctorIdeaA[0]);

			cts13y.setJlx_ave(vFactorA[1]);
			cts13y.setJlx_d(vDoctorIdeaA[1]);

			cts13y.setQbx_ave(vFactorA[2]);
			cts13y.setQbx_d(vDoctorIdeaA[2]);

			cts13y.setSyx_ave(vFactorA[3]);
			cts13y.setSyx_d(vDoctorIdeaA[3]);

			cts13y.setFyqd_ave(vFactorA[4]);
			cts13y.setFyqd_d(vDoctorIdeaA[4]);

			cts13y.setXg_ave(vFactorA[5]);
			cts13y.setXg_d(vDoctorIdeaA[5]);

			cts13y.setCjd_ave(vFactorA[6]);
			cts13y.setCjd_d(vDoctorIdeaA[6]);

			cts13y.setZyfs_ave(vFactorA[7]);
			cts13y.setZyfs_d(vDoctorIdeaA[7]);

			cts13y.setFyf_ave(vFactorA[8]);
			cts13y.setFyf_d(vDoctorIdeaA[8]);

			cts13y.setTotal_a(vAppraise);
			cts13y.setTotal_d(vDoctorIdeaA[9]);

			result.setObject(cts13y);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百零六、2-3岁儿童行为量表(Cbcl2to3)，共99+1题，6个因子，3个选项
	private static ClsAnswerResult GetCbcl2to3FactorScore(ClsAnswerRequest answer) {
		// 1社会退缩，2忧郁，3睡眠问题，4躯体诉述，5攻击，6破坏，7其他问题：第100题的输入内容(不计)
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 99;

			int intI;
			// 转换回原来格式
			String strTemp = answer.getAnswer().replaceAll("\\|@", "@@");
			String[] strAnswer_c = strTemp.split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共一组，0,1,2
			String[] strNumberA = { "2,3,4,10,11,24,37,62,68,70,73,76,92,98",
					"21,25,26,28,43,62,67,70,77,80,82,83,90,98,99", "22,38,48,50,64,74,84,94",
					"1,12,19,24,45,52,54,60,61,63,77,78",
					"5,6,8,13,15,16,17,18,20,23,25,27,29,30,34,35,36,40,44,53,58,59,66,69,81,82,83,85,88,91,96,97",
					"5,14,17,18,31,34,36,41,42,67,70,71,72,75" };
			String[] strSubA;

			float[] vFactorA = new float[6]; // 实际为6个因子
			String[] vDoctorIdeaA = new String[6]; // 医生意见

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
				vDoctorIdeaA[i] = "";
			}

			// 原始分
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactorA[i] += Integer.valueOf(strChildAnswerA[Integer.valueOf(strSubA[j]) - 1]) - 1;
				}
			}

			// 按原始分得到“医生意见”
			int[][] intValueA = { { 6, 7, 9 }, { 3, 4, 6 }, { 5, 6, 100 }, { 3, 4, 5 }, { 15, 18, 20 }, { 5, 8, 10 } };
			for (i = 0; i < intValueA.length; i++) {
				vDoctorIdeaA[i] = "Cbcl2to3." + String.valueOf(i + 1) + ".4";
				for (j = 0; j < intValueA[0].length; j++) {
					if (vFactorA[i] <= intValueA[i][j]) {
						vDoctorIdeaA[i] = "Cbcl2to3." + String.valueOf(i + 1) + "." + String.valueOf(j + 1);
						break;
					}
				}
			}

			ClsScore.Cbcl2to3 cbcl2to3 = new ClsScore.Cbcl2to3();

			cbcl2to3.setShts_o(vFactorA[0]);
			cbcl2to3.setShts_d(vDoctorIdeaA[0]);

			cbcl2to3.setYy_o(vFactorA[1]);
			cbcl2to3.setYy_d(vDoctorIdeaA[1]);

			cbcl2to3.setSmwt_o(vFactorA[2]);
			cbcl2to3.setSmwt_d(vDoctorIdeaA[2]);

			cbcl2to3.setQtss_o(vFactorA[3]);
			cbcl2to3.setQtss_d(vDoctorIdeaA[3]);

			cbcl2to3.setGj_o(vFactorA[4]);
			cbcl2to3.setGj_d(vDoctorIdeaA[4]);

			cbcl2to3.setPh_o(vFactorA[5]);
			cbcl2to3.setPh_d(vDoctorIdeaA[5]);

			result.setObject(cbcl2to3);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百零七、Sarason考试焦虑量表(Sarasontas)，共37题，1个因子，2个选项
	private static ClsAnswerResult GetSarasontasFactorScore(ClsAnswerRequest answer) {
		// 1总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 37;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共2组，第一组1,0；第二组0,1
			String[] strNumberA = {
					"1,2,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,28,30,31,32,34,35,36,37",
					"3,15,26,27,29,33" };
			int[][] intScoreA = { { 1, 0 }, { 0, 1 } };
			String[] strSubA;

			float vFactor = 0;
			String vDoctorIdea = "";

			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactor += intScoreA[i][Integer.valueOf(strChildAnswerA[Integer.valueOf(strSubA[j]) - 1]) - 1];
				}
			}

			// 指导意见
			vDoctorIdea = "Sarasontas.1.3";
			if (vFactor < 12) {
				vDoctorIdea = "Sarasontas.1.1";
			} else if (12 <= vFactor && vFactor <= 20) {
				vDoctorIdea = "Sarasontas.1.2";
			}

			ClsScore.Sarasontas sarasontas = new ClsScore.Sarasontas();

			sarasontas.setTotal_o(vFactor);
			sarasontas.setTotal_d(vDoctorIdea);

			result.setObject(sarasontas);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百零八、婴儿-初中生社会生活能力量表(Sm)，共132题，6个因子，2个选项
	private static ClsAnswerResult GetSmFactorScore(ClsAnswerRequest answer) {
		// 1独立生活，2运动，3作业操作，4交往，5集体活动，6自我管理，7总分，8总分标准分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 132;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共一组，选是1-1，否2-0
			// “总分”为前6个因子相加
			String[] strNumberA = {
					"5,12,14,18,20,21,30,31,36,38,40,41,46,47,49,50,52,53,59,60,64,67,68,82,83,86,97,99,114,117,120",
					"8,10,17,19,29,32,45,55,76,80,90,106,110,113,122,126,130,131",
					"2,7,16,33,35,51,56,62,65,73,77,88,93,103,108,111,116,119,121,132",
					"1,3,11,15,25,28,37,39,57,58,61,66,72,74,84,91,94,95,101,107,123,124,128",
					"4,6,9,13,23,24,34,43,48,54,63,69,78,79,89,92,96,102,104,112,125,129",
					"22,26,27,42,44,70,71,75,81,85,87,98,100,105,109,115,118,127" };
			String[] strSubA;

			float[] vFactorA = new float[8]; // 实际为8个因子

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}
			String vDoctorIdea = "";

			// 原始分
			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactorA[i] += 2 - Integer.valueOf(strChildAnswerA[Integer.valueOf(strSubA[j]) - 1]);
				}
				vFactorA[6] += vFactorA[i]; // 总分
			}

			// 标准分
			int[] intHeadA = { 9, 8, 8, 6, 6, 6, 5, 5, 5, 5, 5, 5 };
			float[] sngAgeA = { 1f, 1.5f, 2f, 2.5f, 3f, 4f, 5f, 6f, 8f, 10f, 12f, 1000f };
			int[][] intValueA = { { 4, 11, 15, 19, 1000, 1000, 1000, 1000, 1000 },
					{ 3, 10, 26, 34, 41, 1000, 1000, 1000, 1000 }, { 8, 18, 38, 48, 58, 1000, 1000, 1000, 1000 },
					{ 2, 12, 21, 30, 49, 59, 68, 1000, 1000 }, { 4, 16, 24, 33, 54, 64, 74, 1000, 1000 },
					{ 6, 18, 29, 41, 66, 77, 89, 1000, 1000 }, { 5, 17, 29, 41, 52, 75, 89, 101, 1000 },
					{ 9, 23, 38, 52, 66, 96, 110, 124, 1000 }, { 30, 43, 55, 68, 81, 107, 120, 132, 1000 },
					{ 38, 53, 67, 81, 96, 125, 1000, 1000, 1000 }, { 63, 75, 87, 98, 110, 123, 1000, 1000, 1000 },
					{ 70, 81, 98, 103, 114, 127, 1000, 1000, 1000 } };
			float sngAge = answer.getAge();
			for (i = 0; i < sngAgeA.length; i++) {
				if (sngAge < sngAgeA[i]) {
					for (j = 0; j < intValueA[0].length; j++) {
						if (vFactorA[6] < intValueA[i][j]) {
							vFactorA[7] = intHeadA[i] + j;
							break;
						}
					}
					break;
				}
			}

			vDoctorIdea = "Sm.1." + String.valueOf(vFactorA[7] - 4);

			ClsScore.Sm sm = new ClsScore.Sm();

			sm.setDlsh_o(vFactorA[0]);
			sm.setYd_o(vFactorA[1]);
			sm.setZycz_o(vFactorA[2]);
			sm.setJw_o(vFactorA[3]);
			sm.setJthd_o(vFactorA[4]);
			sm.setZwgl_o(vFactorA[5]);
			sm.setTotal_o(vFactorA[6]);
			sm.setTotal_s(vFactorA[7]);
			sm.setTotal_d(vDoctorIdea);

			result.setObject(sm);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百零九、学习障碍儿童筛查量表(Xxza)，共24题，3个因子，5个选项
	private static ClsAnswerResult GetXxzaFactorScore(ClsAnswerRequest answer) {
		// 1言语性LD筛查，2非言语性LD筛查，3总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 24;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i;

			// 共1组，1,2,3,4,5
			int[] intNumberA = { 9, 24 };

			float[] vFactorA = new float[3]; // 实际为3个因子
			String[] vDoctorIdeaA = new String[2]; // 指导意见，总分没有

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			vDoctorIdeaA[0] = "";
			vDoctorIdeaA[1] = "";

			int intIndex = 0;
			for (i = 0; i < strChildAnswerA.length; i++) {
				if (i == intNumberA[intIndex]) {
					intIndex += 1;
				}
				vFactorA[intIndex] += Integer.valueOf(strChildAnswerA[i]);
				vFactorA[2] += Integer.valueOf(strChildAnswerA[i]);
			}

			// 指导意见
			vDoctorIdeaA[0] = (vFactorA[0] <= 20 ? "Xxza.1.1" : "Xxza.1.2");
			vDoctorIdeaA[1] = (vFactorA[1] <= 40 ? "Xxza.2.1" : "Xxza.2.2");

			ClsScore.Xxza xxza = new ClsScore.Xxza();

			xxza.setYy_o(vFactorA[0]);
			xxza.setYy_d(vDoctorIdeaA[0]);
			xxza.setFyy_o(vFactorA[1]);
			xxza.setFyy_d(vDoctorIdeaA[1]);
			xxza.setTotal_o(vFactorA[2]);

			result.setObject(xxza);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百十、中国中学生心理健康检测(Xljk)，共60题，11个因子，5个选项
	private static ClsAnswerResult GetXljkFactorScore(ClsAnswerRequest answer) {
		// 1强迫症状，2偏执，3敌对，4人际关系紧张与敌对，5抑郁，6焦虑，7学习压力，8适应不良，9情绪不平衡，10心理不平衡，11总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 60;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共1组，1,2,3,4,5
			String[] strNumberA = { "3,10,12,22,23,48", "11,20,24,26,47,49", "19,21,25,50,52,58", "4,17,18,45,51,59",
					"5,13,14,16,44,57", "6,15,34,43,46,56", "31,33,36,38,40,55", "1,8,9,29,39,41", "2,7,27,32,35,53",
					"28,30,37,42,54,60" };
			String[] strSubA;

			float[][] vFactorA = new float[11][2]; // 实际为11个因子
			String[] vAppraiseA = new String[11]; // 诊断结果
			String[] vDoctorIdeaA = new String[11]; // 指导意见

			for (i = 0; i < vFactorA.length; i++) {
				for (j = 0; j < vFactorA[0].length; j++) {
					vFactorA[i][j] = 0;
				}
				vAppraiseA[i] = "";
				vDoctorIdeaA[i] = "";
			}

			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactorA[i][0] += Integer.valueOf(strChildAnswerA[Integer.valueOf(strSubA[j]) - 1]);
				}
				// 平均分
				BigDecimal bd = new BigDecimal(vFactorA[i][0] / 6);
				vFactorA[i][1] = bd.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
				// 总分
				vFactorA[10][0] += vFactorA[i][0];
			}
			BigDecimal bd1 = new BigDecimal(vFactorA[10][0] / 60);
			vFactorA[10][1] = bd1.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();

			// “诊断结果”和“医生意见”
			for (i = 0; i < vFactorA.length; i++) {
				if (vFactorA[i][1] < 2) {
					vAppraiseA[i] = "无";
					vDoctorIdeaA[i] = "Xljk." + String.valueOf(i + 1) + ".1";
				} else if (2 <= vFactorA[i][1] && vFactorA[i][1] < 3) {
					vAppraiseA[i] = "轻度";
					vDoctorIdeaA[i] = "Xljk." + String.valueOf(i + 1) + ".2";
				} else if (3 <= vFactorA[i][1] && vFactorA[i][1] < 4) {
					vAppraiseA[i] = "中度";
					vDoctorIdeaA[i] = "Xljk." + String.valueOf(i + 1) + ".3";
				} else if (4 <= vFactorA[i][1] && vFactorA[i][1] < 5) {
					vAppraiseA[i] = "较重";
					vDoctorIdeaA[i] = "Xljk." + String.valueOf(i + 1) + ".4";
				} else {
					vAppraiseA[i] = "严重";
					vDoctorIdeaA[i] = "Xljk." + String.valueOf(i + 1) + ".5";
				}
			}

			ClsScore.Xljk xljk = new ClsScore.Xljk();

			xljk.setQbzz_o(vFactorA[0][0]);
			xljk.setQbzz_ave(vFactorA[0][1]);
			xljk.setQbzz_a(vAppraiseA[0]);
			xljk.setQbzz_d(vDoctorIdeaA[0]);

			xljk.setPz_o(vFactorA[1][0]);
			xljk.setPz_ave(vFactorA[1][1]);
			xljk.setPz_a(vAppraiseA[1]);
			xljk.setPz_d(vDoctorIdeaA[1]);

			xljk.setDd_o(vFactorA[2][0]);
			xljk.setDd_ave(vFactorA[2][1]);
			xljk.setDd_a(vAppraiseA[2]);
			xljk.setDd_d(vDoctorIdeaA[2]);

			xljk.setRjgx_o(vFactorA[3][0]);
			xljk.setRjgx_ave(vFactorA[3][1]);
			xljk.setRjgx_a(vAppraiseA[3]);
			xljk.setRjgx_d(vDoctorIdeaA[3]);

			xljk.setYy_o(vFactorA[4][0]);
			xljk.setYy_ave(vFactorA[4][1]);
			xljk.setYy_a(vAppraiseA[4]);
			xljk.setYy_d(vDoctorIdeaA[4]);

			xljk.setJl_o(vFactorA[5][0]);
			xljk.setJl_ave(vFactorA[5][1]);
			xljk.setJl_a(vAppraiseA[5]);
			xljk.setJl_d(vDoctorIdeaA[5]);

			xljk.setXxyl_o(vFactorA[6][0]);
			xljk.setXxyl_ave(vFactorA[6][1]);
			xljk.setXxyl_a(vAppraiseA[6]);
			xljk.setXxyl_d(vDoctorIdeaA[6]);

			xljk.setSybl_o(vFactorA[7][0]);
			xljk.setSybl_ave(vFactorA[7][1]);
			xljk.setSybl_a(vAppraiseA[7]);
			xljk.setSybl_d(vDoctorIdeaA[7]);

			xljk.setQx_o(vFactorA[8][0]);
			xljk.setQx_ave(vFactorA[8][1]);
			xljk.setQx_a(vAppraiseA[8]);
			xljk.setQx_d(vDoctorIdeaA[8]);

			xljk.setXl_o(vFactorA[9][0]);
			xljk.setXl_ave(vFactorA[9][1]);
			xljk.setXl_a(vAppraiseA[9]);
			xljk.setXl_d(vDoctorIdeaA[9]);

			xljk.setTotal_o(vFactorA[10][0]);
			xljk.setTotal_ave(vFactorA[10][1]);
			xljk.setTotal_a(vAppraiseA[10]);
			xljk.setTotal_d(vDoctorIdeaA[10]);

			result.setObject(xljk);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百十一、新生儿20项行为神经评定(Baby20)，共20题，6个因子，3个选项
	private static ClsAnswerResult GetBaby20FactorScore(ClsAnswerRequest answer) {
		// 1行为能力，2被动肌张力，3主动肌张力，4原始反射，5一般反应，6总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 20;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i;

			// 共1组，0,1,2
			int[] intNumberA = { 6, 10, 14, 17, 20 };

			float[] vFactorA = new float[6]; // 实际为6个因子
			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
			}

			int intIndex = 0;
			for (i = 0; i < strChildAnswerA.length; i++) {
				if (i == intNumberA[intIndex]) {
					intIndex += 1;
				}
				vFactorA[intIndex] += Integer.valueOf(strChildAnswerA[i]) - 1;
				vFactorA[5] += Integer.valueOf(strChildAnswerA[i]) - 1;
			}

			ClsScore.Baby20 baby20 = new ClsScore.Baby20();

			baby20.setXw_o(vFactorA[0]);
			baby20.setBd_o(vFactorA[1]);
			baby20.setZd_o(vFactorA[2]);
			baby20.setYs_o(vFactorA[3]);
			baby20.setYb_o(vFactorA[4]);
			baby20.setTotal_o(vFactorA[5]);

			result.setObject(baby20);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百十二、超常行为检查表(4-12岁)(Genius1)，共115题，7个因子，5个选项
	private static ClsAnswerResult GetGenius1FactorScore(ClsAnswerRequest answer) {
		// 1智力，2创造力，3美术创造力，4音乐创造力，5社会活动和领导能力，6身体能力，7总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 115;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共1组，1,2,3,4,5
			int[] intNumberA = { 37, 69, 75, 82, 102, 115 };

			float[] vFactorA = new float[7]; // 实际为7个因子
			String[] vDoctorIdeaA = new String[7]; // 指导意见

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
				vDoctorIdeaA[i] = "";
			}

			int intIndex = 0;
			for (i = 0; i < strChildAnswerA.length; i++) {
				if (i == intNumberA[intIndex]) {
					intIndex += 1;
				}
				vFactorA[intIndex] += Integer.valueOf(strChildAnswerA[i]);
				vFactorA[6] += Integer.valueOf(strChildAnswerA[i]); // 总分
			}

			// 指导意见
			int[][] arrNum = { { 52, 79, 105, 132, 165 }, { 47, 75, 91, 128, 0 }, { 10, 15, 20, 25, 0 },
					{ 11, 16, 23, 30, 0 }, { 33, 49, 66, 83, 0 }, { 17, 25, 34, 43, 0 }, { 151, 230, 299, 388, 485 } };
			int[] arrLevel = { 6, 5, 5, 5, 5, 5, 6 };
			for (i = 0; i < arrNum.length; i++) {
				vDoctorIdeaA[i] = "Genius1." + String.valueOf(i + 1) + "." + String.valueOf(arrLevel[i]);
				// 原始代码
				// For j = 0 To arrLevel(i) - 2
				for (j = 0; j < arrLevel[i] - 1; j++) {
					if (vFactorA[i] <= arrNum[i][j]) {
						vDoctorIdeaA[i] = "Genius1." + String.valueOf(i + 1) + "." + String.valueOf(j + 1);
						break;
					}
				}
			}

			ClsScore.Genius1 genius1 = new ClsScore.Genius1();

			genius1.setZl_o(vFactorA[0]);
			genius1.setZl_d(vDoctorIdeaA[0]);

			genius1.setCzl_o(vFactorA[1]);
			genius1.setCzl_d(vDoctorIdeaA[1]);

			genius1.setMs_o(vFactorA[2]);
			genius1.setMs_d(vDoctorIdeaA[2]);

			genius1.setYy_o(vFactorA[3]);
			genius1.setYy_d(vDoctorIdeaA[3]);

			genius1.setSh_o(vFactorA[4]);
			genius1.setSh_d(vDoctorIdeaA[4]);

			genius1.setSt_o(vFactorA[5]);
			genius1.setSt_d(vDoctorIdeaA[5]);

			genius1.setTotal_o(vFactorA[6]);
			genius1.setTotal_d(vDoctorIdeaA[6]);

			result.setObject(genius1);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百十三、超常行为检查表(12岁以上)(Genius2)，共92题，5个因子，5个选项
	private static ClsAnswerResult GetGenius2FactorScore(ClsAnswerRequest answer) {
		// 1智力，2创造力，3社会活动和领导能力，4身体能力，5总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 92;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共1组，1,2,3,4,5
			int[] intNumberA = { 29, 61, 81, 92 };

			float[] vFactorA = new float[5]; // 实际为5个因子
			String[] vDoctorIdeaA = new String[5]; // 指导意见

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
				vDoctorIdeaA[i] = "";
			}

			int intIndex = 0;
			for (i = 0; i < strChildAnswerA.length; i++) {
				if (i == intNumberA[intIndex]) {
					intIndex += 1;
				}
				vFactorA[intIndex] += Integer.valueOf(strChildAnswerA[i]);
				vFactorA[4] += Integer.valueOf(strChildAnswerA[i]); // 总分
			}

			// 指导意见
			int[][] arrNum = { { 52, 79, 105, 132, 165 }, { 47, 75, 91, 128, 0 }, { 33, 49, 66, 83, 0 },
					{ 17, 25, 34, 43, 0 }, { 151, 230, 299, 388, 485 } };
			int[] arrLevel = { 6, 5, 5, 5, 6 };
			for (i = 0; i < arrNum.length; i++) {
				vDoctorIdeaA[i] = "Genius2." + String.valueOf(i + 1) + "." + String.valueOf(arrLevel[i]);
				for (j = 0; j < arrLevel[i] - 1; j++) {
					if (vFactorA[i] <= arrNum[i][j]) {
						vDoctorIdeaA[i] = "Genius2." + String.valueOf(i + 1) + "." + String.valueOf(j + 1);
						break;
					}
				}
			}

			ClsScore.Genius2 genius2 = new ClsScore.Genius2();

			genius2.setZl_o(vFactorA[0]);
			genius2.setZl_d(vDoctorIdeaA[0]);

			genius2.setCzl_o(vFactorA[1]);
			genius2.setCzl_d(vDoctorIdeaA[1]);

			genius2.setSh_o(vFactorA[2]);
			genius2.setSh_d(vDoctorIdeaA[2]);

			genius2.setSt_o(vFactorA[3]);
			genius2.setSt_d(vDoctorIdeaA[3]);

			genius2.setTotal_o(vFactorA[4]);
			genius2.setTotal_d(vDoctorIdeaA[4]);

			result.setObject(genius2);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百十四、威廉斯创造力倾向测验(Create)，共50题，5个因子，3个选项
	private static ClsAnswerResult GetCreateFactorScore(ClsAnswerRequest answer) {
		// '1冒险性，2好奇性，3想象力，4挑战性，5总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 50;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j, k;

			// 共2组，第一组1,2,3；第二组3,2,1
			String[][] strNumberA = { { "1,5,21,24,25,28,36,43,44", "29,35" },
					{ "2,8,11,19,27,33,34,37,38,39,47,49", "12,48" }, { "6,13,14,16,20,22,23,30,31,32,40,46", "45" },
					{ "3,7,10,15,18,26,41,42,50", "4,9,17" } };
			int[][] intScoreA = { { 1, 2, 3 }, { 3, 2, 1 } };
			String[] strSubA;

			float[] vFactorA = new float[5]; // 实际为5个因子
			String[] vDoctorIdeaA = new String[5]; // 指导意见

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
				vDoctorIdeaA[i] = "";
			}

			for (i = 0; i < strNumberA.length; i++) {
				for (j = 0; j < strNumberA[0].length; j++) {
					strSubA = strNumberA[i][j].split(",");
					for (k = 0; k < strSubA.length; k++) {
						vFactorA[i] += intScoreA[j][Integer.valueOf(strChildAnswerA[Integer.valueOf(strSubA[k]) - 1])
								- 1];
					}
				}
				vFactorA[4] += vFactorA[i]; // 总分
			}

			// 指导意见
			int[][] intNumA = { { 13, 18, 23, 28 }, { 18, 24, 30, 36 }, { 17, 23, 28, 34 }, { 15, 21, 26, 31 },
					{ 66, 89, 110, 132 } };
			for (i = 0; i < intNumA.length; i++) {
				vDoctorIdeaA[i] = "Create." + String.valueOf(i + 1) + ".5";
				for (j = 0; j < intNumA[0].length; j++) {
					if (vFactorA[i] < intNumA[i][j]) {
						vDoctorIdeaA[i] = "Create." + String.valueOf(i + 1) + "." + String.valueOf(j + 1);
						break;
					}
				}
			}

			ClsScore.Create create = new ClsScore.Create();

			create.setMx_o(vFactorA[0]);
			create.setMx_d(vDoctorIdeaA[0]);

			create.setHq_o(vFactorA[1]);
			create.setHq_d(vDoctorIdeaA[1]);

			create.setXx_o(vFactorA[2]);
			create.setXx_d(vDoctorIdeaA[2]);

			create.setTz_o(vFactorA[3]);
			create.setTz_d(vDoctorIdeaA[3]);

			create.setTotal_o(vFactorA[4]);
			create.setTotal_d(vDoctorIdeaA[4]);

			result.setObject(create);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百十五、中学生学习方法测验(Xxff)，共10题，1个因子，3个选项
	private static ClsAnswerResult GetXxffFactorScore(ClsAnswerRequest answer) {
		// 1总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 10;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i;

			// 共1组，0,1,2

			float vFactor = 0;
			String vDoctorIdea = "";

			for (i = 0; i < strChildAnswerA.length; i++) {
				vFactor += Integer.valueOf(strChildAnswerA[i]) - 1;
			}

			vDoctorIdea = "Xxff.1.1";

			ClsScore.Xxff xxff = new ClsScore.Xxff();

			xxff.setTotal_o(vFactor);
			xxff.setTotal_d(vDoctorIdea);

			result.setObject(xxff);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百十六、中学生学习动机调查表(Xxdj)，共20题，4个因子，2个选项
	private static ClsAnswerResult GetXxdjFactorScore(ClsAnswerRequest answer) {
		// 1学习动机，2学习压力，3学习兴趣，4学习目标
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 20;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i;

			// 2学习压力，为反向计分
			// 共2组，是0，否1
			int[] intNumberA = { 5, 10, 15, 20 };

			float[] vFactorA = new float[4]; // 实际为4个因子
			String[] vAppraiseA = new String[4]; // 诊断结果

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
				vAppraiseA[i] = "";
			}
			int intIndex = 0;
			for (i = 0; i < strChildAnswerA.length; i++) {
				if (i == intNumberA[intIndex]) {
					intIndex += 1;
				}
				if (intIndex == 1) // 学习压力，反向计分
				{
					vFactorA[intIndex] += 2 - Integer.valueOf(strChildAnswerA[i]);
				} else {
					vFactorA[intIndex] += Integer.valueOf(strChildAnswerA[i]) - 1;
				}
			}

			String[][] arrApp = { { "强", "较强", "很弱" }, { "很大", "较大", "适当" }, { "没有困扰", "有困扰", "有很大困扰" },
					{ "合理", "比较合理", "不太合理" } };
			for (i = 0; i < arrApp.length; i++) {
				vAppraiseA[i] = arrApp[i][2];
				if (vFactorA[i] >= 50) {
					vAppraiseA[i] = arrApp[i][0];
				} else if (vFactorA[i] >= 4 && vFactorA[i] < 50) {
					vAppraiseA[i] = arrApp[i][1];
				}
			}

			ClsScore.Xxdj xxdj = new ClsScore.Xxdj();

			xxdj.setDj_o(vFactorA[0]);
			xxdj.setDj_a(vAppraiseA[0]);

			xxdj.setYl_o(vFactorA[1]);
			xxdj.setYl_a(vAppraiseA[1]);

			xxdj.setXq_o(vFactorA[2]);
			xxdj.setXq_a(vAppraiseA[2]);

			xxdj.setMb_o(vFactorA[3]);
			xxdj.setMb_a(vAppraiseA[3]);

			result.setObject(xxdj);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百十七、中学生意志力调查表(Yzldc)，共20题，1个因子，5个选项
	private static ClsAnswerResult GetYzldcFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 20;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i;

			// 共2组，第一组1,2,3,4,5；第二组5,4,3,2,1

			float vFactor = 0;
			String vDoctorIdea = "";

			for (i = 0; i < strChildAnswerA.length; i += 2) {
				vFactor += 6 - Integer.valueOf(strChildAnswerA[i]);
				vFactor += Integer.valueOf(strChildAnswerA[i + 1]);
			}

			int[] intNumA = { 21, 41, 61, 81 };
			vDoctorIdea = "Yzldc.1." + String.valueOf(intNumA.length + 1);
			for (i = 0; i < intNumA.length; i++) {
				if (vFactor < intNumA[i]) {
					vDoctorIdea = "Yzldc.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Yzldc yzldc = new ClsScore.Yzldc();

			yzldc.setTotal_o(vFactor);
			yzldc.setTotal_d(vDoctorIdea);

			result.setObject(yzldc);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百十八、考试行为困扰心理测查(Ksxwkl)，共40题，4个因子，3个选项
	private static ClsAnswerResult GetKsxwklFactorScore(ClsAnswerRequest answer) {
		// 1动机与效果，2应试技巧，3考前身心健康，4心理控制能力
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 40;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i;

			// 4心理控制能力，反向计分
			// 共1组，2,1,0
			int[] intNumberA = { 10, 20, 30, 40 };

			float[] vFactorA = new float[4]; // 实际为4个因子
			String[] vDoctorIdeaA = new String[4]; // 指导意见

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
				vDoctorIdeaA[i] = "";
			}

			int intIndex = 0;
			for (i = 0; i < strChildAnswerA.length; i++) {
				if (i == intNumberA[intIndex]) {
					intIndex += 1;
				}
				if (intIndex == 3) // 心理控制能力，反向计分
				{
					vFactorA[intIndex] += Integer.valueOf(strChildAnswerA[i]) - 1;
				} else {
					vFactorA[intIndex] += 3 - Integer.valueOf(strChildAnswerA[i]);
				}
			}

			// 指导意见(与得分没有关系)
			for (i = 0; i < vDoctorIdeaA.length; i++) {
				vDoctorIdeaA[i] = "Ksxwkl." + String.valueOf(i + 1) + ".1";
			}

			ClsScore.Ksxwkl ksxwkl = new ClsScore.Ksxwkl();

			ksxwkl.setDj_o(vFactorA[0]);
			ksxwkl.setDj_d(vDoctorIdeaA[0]);

			ksxwkl.setSs_o(vFactorA[1]);
			ksxwkl.setSs_d(vDoctorIdeaA[1]);

			ksxwkl.setKq_o(vFactorA[2]);
			ksxwkl.setKq_d(vDoctorIdeaA[2]);

			ksxwkl.setXl_o(vFactorA[3]);
			ksxwkl.setXl_d(vDoctorIdeaA[3]);

			result.setObject(ksxwkl);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百十九、中学生自信心困扰检测(Zbxl)，共15题，1个因子，3个选项
	private static ClsAnswerResult GetZbxlFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 15;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共5组，第一组5,3,1；第二组5,1,3；第三组1,5,3；第四组3,1,5；第五组3,5,1
			String[] strNumberA = { "1,2,9,12", "3,4,5,7,11", "6,10,14", "8", "13,15" };
			int[][] intScoreA = { { 5, 3, 1 }, { 5, 1, 3 }, { 1, 5, 3 }, { 3, 1, 5 }, { 3, 5, 1 } };
			String[] strSubA;

			float vFactor = 0;
			String vAppraise = "";
			String vDoctorIdea = "";

			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactor += intScoreA[i][Integer.valueOf(strChildAnswerA[Integer.valueOf(strSubA[j]) - 1]) - 1];
				}
			}

			String[] strAppA = { "环境变化影响自信", "动机与期望过高而影响自信", "过早断定影响自信", "性格怯懦影响自信" };
			int[] intNumA = { 30, 45, 61 };
			vAppraise = strAppA[strAppA.length - 1];
			vDoctorIdea = "Zbxl.1." + String.valueOf(strAppA.length);
			for (i = 0; i < intNumA.length; i++) {
				if (vFactor < intNumA[i]) {
					vDoctorIdea = "Zbxl.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Zbxl zbxl = new ClsScore.Zbxl();

			zbxl.setTotal_o(vFactor);
			zbxl.setTotal_a(vAppraise);
			zbxl.setTotal_d(vDoctorIdea);

			result.setObject(zbxl);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百二十、中学生在校适应能力诊断(Zxsynl)，共20题，1个因子，3个选项
	private static ClsAnswerResult GetZxsynlFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 20;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i;

			// 共2组，第一组-2,0,2；第二组2,0,-2
			int[][] intScoreA = { { -2, 0, 2 }, { 2, 0, -2 } };

			float vFactor = 0;
			String vDoctorIdea = "";

			for (i = 0; i < strChildAnswerA.length; i += 2) {
				vFactor += intScoreA[0][Integer.valueOf(strChildAnswerA[i]) - 1];
				vFactor += intScoreA[1][Integer.valueOf(strChildAnswerA[i + 1]) - 1];
			}

			// 指导意见
			int[] intNumA = { 35, 29, 17, 6 };
			vDoctorIdea = "Zxsynl.1.5";
			for (i = 0; i < intNumA.length; i++) {
				if (vFactor >= intNumA[i]) {
					vDoctorIdea = "Zxsynl.1." + String.valueOf(i + 1);
					break;
				}
			}

			ClsScore.Zxsynl zxsynl = new ClsScore.Zxsynl();

			zxsynl.setTotal_o(vFactor);
			zxsynl.setTotal_d(vDoctorIdea);

			result.setObject(zxsynl);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百二十一、学生人际交往能力自我评定(Rjjwnl)，共15题，4个因子，3个选项
	private static ClsAnswerResult GetRjjwnlFactorScore(ClsAnswerRequest answer) {
		// 1总分，2同学关系，3家庭关系，4师生关系
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 15;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共1组，1,2,3
			int[] intNumberA = { 5, 10, 15 };

			float[] vFactorA = new float[4]; // 实际为4个因子
			String[] vAppraiseA = new String[4];

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
				vAppraiseA[i] = "";
			}

			int intIndex = 0;
			for (i = 0; i < strChildAnswerA.length; i++) {
				if (i == intNumberA[intIndex]) {
					intIndex += 1;
				}
				vFactorA[intIndex + 1] += Integer.valueOf(strChildAnswerA[i]);
				vFactorA[0] += Integer.valueOf(strChildAnswerA[i]); // 总分
			}

			// 诊断结果
			String[][] arrApp = { { "交往能力强，人际关系好。", "交往能力一般。", "交往能力弱，人际关系一般。" }, { "关系良好。", "关系一般。", "关系较差。" },
					{ "关系良好。", "关系一般。", "关系较差。" }, { "关系良好。", "关系一般。", "关系较差。" } };
			float[][] arrNum = { { 36f, 20f }, { 12f, 7f }, { 12f, 7f }, { 12f, 7f } };

			for (i = 0; i < arrApp.length; i++) {
				vAppraiseA[i] = arrApp[i][arrApp[0].length - 1];
				for (j = 0; j < arrNum[0].length; j++) {
					if (vFactorA[i] > arrNum[i][j]) {
						vAppraiseA[i] = arrApp[i][j];
						break;
					}
				}
			}

			ClsScore.Rjjwnl rjjwnl = new ClsScore.Rjjwnl();

			rjjwnl.setTotal_o(vFactorA[0]);
			rjjwnl.setTotal_a(vAppraiseA[0]);

			rjjwnl.setTx_o(vFactorA[1]);
			rjjwnl.setTx_a(vAppraiseA[1]);

			rjjwnl.setJt_o(vFactorA[2]);
			rjjwnl.setJt_a(vAppraiseA[2]);

			rjjwnl.setSs_o(vFactorA[3]);
			rjjwnl.setSs_a(vAppraiseA[3]);

			result.setObject(rjjwnl);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百二十二、同学关系困扰调查表(Txgxkr)，共28题，5个因子，2个选项
	private static ClsAnswerResult GetTxgxkrFactorScore(ClsAnswerRequest answer) {
		// 1总分，2言语沟通，3交往行为，4待人接物，5异性交往
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 28;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共1组，1,0

			float[] vFactorA = new float[5]; // 实际为5个因子
			String[] vAppraiseA = new String[5]; // 诊断结果

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
				vAppraiseA[i] = "";
			}

			for (i = 0; i < strChildAnswerA.length; i += 4) {
				for (j = 0; j < 4; j++) {
					vFactorA[j + 1] += 2 - Integer.valueOf(strChildAnswerA[i + j]);
					vFactorA[0] += 2 - Integer.valueOf(strChildAnswerA[i + j]); // 总分
				}
			}

			// 诊断结果
			// 总分
			int[] arrTotalNum = { 9, 15, 20 };
			String[] arrTotalApp = { "说明你与朋友相处的困扰较少。", "说明你与朋友相处存在一定程度的困扰。", "说明你与朋友相处的行为困扰较严重。",
					"说明你与朋友相处存在严重的行为困扰。" };
			vAppraiseA[0] = arrTotalApp[arrTotalApp.length - 1];
			for (i = 0; i < arrTotalNum.length; i++) {
				if (vFactorA[0] < arrTotalNum[i]) {
					vAppraiseA[0] = arrTotalApp[i];
					break;
				}
			}

			// 其他4个因子
			int[][] arrNum = { { 6, 3 }, { 6, 3 }, { 6, 3 }, { 5, 3 } };
			String[][] arrApp = { { "不善于交谈。", "交谈能力一般。", "有较高的交谈能力和技巧。" }, { "行为困扰较大。", "交际与交友较被动。", "行为困扰少，为人真诚、热情。" },
					{ "缺乏待人接物的机智与技巧。", "可能是个多侧面的人。", "待人接物能力强。" },
					{ "存在较严重的困扰。", "行为困扰程度一般。", "较懂得正确处理与异性同学、朋友的关系。" } };
			for (i = 0; i < arrNum.length; i++) {
				vAppraiseA[i + 1] = arrApp[i][arrApp[0].length - 1];
				for (j = 0; j < arrNum[0].length; j++) {
					if (vFactorA[i + 1] >= arrNum[i][j]) {
						vAppraiseA[i + 1] = arrApp[i][j];
						break;
					}
				}
			}

			ClsScore.Txgxkr txgxkr = new ClsScore.Txgxkr();

			txgxkr.setTotal_o(vFactorA[0]);
			txgxkr.setTotal_a(vAppraiseA[0]);

			txgxkr.setYygt_o(vFactorA[1]);
			txgxkr.setYygt_a(vAppraiseA[1]);

			txgxkr.setJwxw_o(vFactorA[2]);
			txgxkr.setJwxw_a(vAppraiseA[2]);

			txgxkr.setDrjw_o(vFactorA[3]);
			txgxkr.setDrjw_a(vAppraiseA[3]);

			txgxkr.setYxjw_o(vFactorA[4]);
			txgxkr.setYxjw_a(vAppraiseA[4]);

			result.setObject(txgxkr);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百二十三、师生关系困扰调查表(Ssgxkr)，共18题，4个因子，2个选项
	private static ClsAnswerResult GetSsgxkrFactorScore(ClsAnswerRequest answer) {
		// 1总分，2教学过程，3情感距离，4地位关系
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 18;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共1组，2,1

			float[] vFactorA = new float[4]; // 实际为4个因子
			String[] vAppraiseA = new String[4]; // 诊断结果

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
				vAppraiseA[i] = "";
			}

			for (i = 0; i < strChildAnswerA.length; i += 3) {
				for (j = 0; j < 3; j++) {
					vFactorA[j + 1] += 3 - Integer.valueOf(strChildAnswerA[i + j]);
					vFactorA[0] += 3 - Integer.valueOf(strChildAnswerA[i + j]); // 总分
				}
			}

			// 诊断结果
			String[] arrApp = { "困扰程度严重或比较严重。", "困扰程度中度。", "困扰程度较轻或很轻微。" };
			float[][] arrNum = { { 31f, 23f }, { 11f, 8f }, { 10f, 8f }, { 10f, 8f } };
			for (i = 0; i < arrNum.length; i++) {
				vAppraiseA[i] = arrApp[arrApp.length - 1];
				for (j = 0; j < arrNum[0].length; j++) {
					if (vFactorA[i] >= arrNum[i][j]) {
						vAppraiseA[i] = arrApp[j];
						break;
					}
				}
			}

			ClsScore.Ssgxkr ssgxkr = new ClsScore.Ssgxkr();

			ssgxkr.setTotal_o(vFactorA[0]);
			ssgxkr.setTotal_a(vAppraiseA[0]);

			ssgxkr.setJxgc_o(vFactorA[1]);
			ssgxkr.setJxgc_a(vAppraiseA[1]);

			ssgxkr.setQgjl_o(vFactorA[2]);
			ssgxkr.setQgjl_a(vAppraiseA[2]);

			ssgxkr.setDwgx_o(vFactorA[3]);
			ssgxkr.setDwgx_a(vAppraiseA[3]);

			result.setObject(ssgxkr);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百二十四、一般自我效能感测验(中学)(Ybzwxng)，共10题，1个因子，4个选项
	private static ClsAnswerResult GetYbzwxngFactorScore(ClsAnswerRequest answer) {
		// 总分
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 10;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共1组，1,2,3,4

			float[][] vFactorA = new float[1][2]; // 实际为1个因子
			for (i = 0; i < vFactorA.length; i++) {
				for (j = 0; j < vFactorA[0].length; j++) {
					vFactorA[i][j] = 0;
				}
			}
			String vDoctorIdea = "";

			for (i = 0; i < strChildAnswerA.length; i++) {
				vFactorA[0][0] += Integer.valueOf(strChildAnswerA[i]);
			}
			// 平均分
			BigDecimal bd = new BigDecimal(vFactorA[0][0] / MAX_NUM);
			vFactorA[0][1] = bd.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();

			int intSex = answer.getSex();
			if (intSex == 1) {
				vDoctorIdea = "Ybzwxng.1.1";
			} else {
				vDoctorIdea = "Ybzwxng.1.2";
			}

			ClsScore.Ybzwxng ybzwxng = new ClsScore.Ybzwxng();

			ybzwxng.setTotal_o(vFactorA[0][0]);
			ybzwxng.setTotal_ave(vFactorA[0][1]);
			ybzwxng.setTotal_d(vDoctorIdea);

			result.setObject(ybzwxng);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}

	// 一百二十五、一般性焦虑问卷(Gat)，共100题，10个因子，2个选项
	private static ClsAnswerResult GetGatFactorScore(ClsAnswerRequest answer) {
		// 1总分，2学习不安，3对人不安，4孤独倾向，5自责倾向，6过敏倾向，7身体征候，8恐惧倾向，9冲动倾向，10信度
		ClsAnswerResult result = new ClsAnswerResult();
		result.setMessage("");
		result.setType(answer.getType());
		result.setUuid(answer.getUuid());
		try {
			// 1正确题数
			int MAX_NUM = 100;

			int intI;
			String[] strAnswer_c = answer.getAnswer().split(g_sChar);
			if (strAnswer_c.length > 1) {
				for (intI = 1; intI < strAnswer_c.length; intI++) {
					strAnswer_c[intI] = strAnswer_c[intI].trim();
				}
			}

			String[] strChildAnswerA = strAnswer_c[0].toString().split(g_nChar);

			if (strChildAnswerA.length != MAX_NUM) {
				result.setMessage("答案数量不符！");
				return result;
			}

			int i, j;

			// 共1组，1,0
			String[] strNumberA = { "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15", "16,17,18,19,20,21,22,23,24,25",
					"26,27,28,29,30,31,32,33,34,35", "36,37,38,39,40,41,42,43,44,45", "46,47,48,49,50,51,52,53,54,55",
					"56,57,58,59,60,61,62,63,64,65,66,67,68,69,70", "71,72,73,74,75,76,77,78,79,80",
					"81,83,85,87,89,91,93,95,97,99", "82,84,86,88,90,92,94,96,98,100" };
			String[] strSubA;

			float[] vFactorA = new float[10]; // 实际为10个因子
			String[] vAppraiseA = new String[10]; // 诊断结果

			for (i = 0; i < vFactorA.length; i++) {
				vFactorA[i] = 0;
				vAppraiseA[i] = "";
			}

			for (i = 0; i < strNumberA.length; i++) {
				strSubA = strNumberA[i].split(",");
				for (j = 0; j < strSubA.length; j++) {
					vFactorA[i + 1] += 2 - Integer.valueOf(strChildAnswerA[Integer.valueOf(strSubA[j]) - 1]);
				}
				vFactorA[0] += vFactorA[i + 1]; // 总分
			}

			// 诊断结果
			int[][] intNumA;
			int intSex = answer.getSex();
			if (intSex == 1) {
				int[][] arrNum = { { 52, 26 }, { 13, 7 }, { 7, 2 }, { 6, 1 }, { 8, 3 }, { 8, 2 }, { 9, 2 }, { 8, 1 },
						{ 7, 2 } };
				intNumA = arrNum;
			} else {
				int[][] arrNum = { { 57, 31 }, { 13, 7 }, { 8, 3 }, { 7, 1 }, { 9, 3 }, { 9, 3 }, { 10, 3 }, { 8, 3 },
						{ 7, 2 } };
				intNumA = arrNum;
			}

			String[] arrApp = { "异常，需要接受心理辅导。", "正常。" };
			for (i = 0; i < intNumA.length; i++) {
				vAppraiseA[i] = arrApp[arrApp.length - 1];
				for (j = 0; j < intNumA[0].length; j++) {
					if (vFactorA[i] >= intNumA[i][j]) {
						vAppraiseA[i] = arrApp[j];
						break;
					}
				}
			}
			// 信度
			vAppraiseA[9] = "测试合作认真，回答真实可靠。";
			if (vFactorA[9] >= 7) {
				vAppraiseA[9] = "回答真实性差，影响测试效果。";
			} else if (vFactorA[9] >= 4 && vFactorA[9] < 7) {
				vAppraiseA[9] = "回答比较真实，略有掩饰或随意。";
			}

			ClsScore.Gat gat = new ClsScore.Gat();

			gat.setTotal_o(vFactorA[0]);
			gat.setTotal_a(vAppraiseA[0]);

			gat.setXx_o(vFactorA[1]);
			gat.setXx_a(vAppraiseA[1]);

			gat.setDr_o(vFactorA[2]);
			gat.setDr_a(vAppraiseA[2]);

			gat.setGd_o(vFactorA[3]);
			gat.setGd_a(vAppraiseA[3]);

			gat.setZz_o(vFactorA[4]);
			gat.setZz_a(vAppraiseA[4]);

			gat.setGm_o(vFactorA[5]);
			gat.setGm_a(vAppraiseA[5]);

			gat.setSt_o(vFactorA[6]);
			gat.setSt_a(vAppraiseA[6]);

			gat.setKj_o(vFactorA[7]);
			gat.setKj_a(vAppraiseA[7]);

			gat.setCd_o(vFactorA[8]);
			gat.setCd_a(vAppraiseA[8]);

			gat.setXd_o(vFactorA[9]);
			gat.setXd_a(vAppraiseA[9]);

			result.setObject(gat);
			return result;
		} catch (ArithmeticException e) {
			result.setMessage(e.toString());
			return result;
		}
	}




}
